Skip to content

Instantly share code, notes, and snippets.

@TearTheSky
Created April 12, 2013 09:21
Show Gist options
  • Save TearTheSky/5370779 to your computer and use it in GitHub Desktop.
Save TearTheSky/5370779 to your computer and use it in GitHub Desktop.
カレントフォルダ以下のフォルダ名を引数に入れる。 存在すれば何もしない。 存在しなければその名前のフォルダを作る。
#フォルダの存在を確認して、無ければ作る関数
Function Create-Folder( $folderName ) {
if(Test-Path $folderName) {
}
else {
$currentDirectory = Get-Location
$createLocation = "$currentDirectory\$folderName"
New-Item -type directory $createLocation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment