In other words, in Powershell, how to create directories recursively, and not fail if each directory level already exist ?
In other words, in Powershell, how to create directories recursively, and not fail if each directory level already exist ?
The mkdir -p command does two things:
To achieve this behavior for in Powershell, use:
New-Item which already creates paths recursively-Force to fail silently if paths already existHence, to create C:/x/y where x and y must be directories, use:
New-Item -ItemType Directory -Path C:/x/y -Force
To create C:/x/y where x is a directory and y a file, use:
New-Item -ItemType File -Path C:/x/y -Force