Skip to content

Instantly share code, notes, and snippets.

@bsara
Last active March 28, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bsara/1405dd9b1d8f08d78beb to your computer and use it in GitHub Desktop.
Save bsara/1405dd9b1d8f08d78beb to your computer and use it in GitHub Desktop.
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