Created
April 15, 2013 00:38
-
-
Save TearTheSky/5384899 to your computer and use it in GitHub Desktop.
ファイル存在確認関数。ファイルが存在する場合はTrueを返す。ファイルが存在しない場合はメッセージを出力してfalseを返す。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ファイル存在確認関数 | |
Function CheckFileExist($fileName) { | |
$resultCheckFileExist = Test-Path $fileName | |
if($resultCheckFileExist -eq $false) { | |
#いない場合は怒って終了 | |
Write-Host "ファイル名「$fileName」は存在しません。" | |
return $false | |
} | |
else { | |
return $true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment