2
我想將MSDOS腳本轉換爲使用Powershell。但是,我一直無法弄清楚如何查看是否存在可變路徑。如何使用powershell命令檢查變量目錄是否存在?
「如果存在%〜DP0%MyNewPig%\ PigBreeds \%類型%%犬種%%斑紋%_%EarNotch%\ NUL轉到skipthis」
你能幫忙嗎?
弱旅
我想將MSDOS腳本轉換爲使用Powershell。但是,我一直無法弄清楚如何查看是否存在可變路徑。如何使用powershell命令檢查變量目錄是否存在?
「如果存在%〜DP0%MyNewPig%\ PigBreeds \%類型%%犬種%%斑紋%_%EarNotch%\ NUL轉到skipthis」
你能幫忙嗎?
弱旅
這將是這個樣子:「這個客戶目錄已存在」
$ScriptRoot = Split-Path $script:MyInvocation.MyCommand.Path
if (Test-Path "$ScriptRoot\$PigBreed\Breeds\$MyNewPig_$PitBreed_$EarNotch\nul") {
#Do whatever SKIPTHIS does here
}
這完全符合SKIPTHIS工作被改爲寫主機 休息;謝謝你! – Underdog