Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PowerShell: Function that creates a directory if it doesn't exist, does NOT throw an error if directory already exists
function Create-Directory($dirPath) {
if (!(Test-Path $dirPath)) {
New-Item -ItemType directory -Path $dirPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment