How to create a directory if not exists in PowerShell?

You can use PowerShell cmdlet New-Item to create a new directory. If you want to also test if the directory not already present before creating the directory, use PowerShell cmdlet Test-Path.