PowerShell – Create a Directory (Path/Folder) If It Doesn’t Exit
Frequently in PowerShell, we need to add a directory if it doesn’t already exist. Simple Code – Check If the Directory Exists First This assumes the higher level directories exist, and you just want to add the lowest level directory: <pre> $targetFilePath = "e:\Dropbox\Audios\Album\Sinatra" if (!(Test-Path $targetFilePath)) { New-Item -ItemType Directory -Path $targetFilePath | […]