Create directory if it does not exist
Create directory if it does not exist
Create directory if it does not exist
Re: Create directory if it does not exist
Try the `-Force` parameter:
```
New-Item -ItemType Directory -Force -Path C:\Path\That\May\Or\May\Not\Exist
```
You can use [`Test-Path -PathType Container`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-path?view=powershell-5.1) to check first.
See the [New-Item](https://learn.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/New-Item) MSDN help article for more details.
```
New-Item -ItemType Directory -Force -Path C:\Path\That\May\Or\May\Not\Exist
```
You can use [`Test-Path -PathType Container`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-path?view=powershell-5.1) to check first.
See the [New-Item](https://learn.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/New-Item) MSDN help article for more details.