SyntaxFix
Write A Post
Hire A Developer
Questions
Try the -Force parameter:
-Force
New-Item -ItemType Directory -Force -Path C:\Path\That\May\Or\May\Not\Exist
You can use Test-Path -PathType Container to check first.
Test-Path -PathType Container
See the New-Item MSDN help article for more details.