Reference:
try {
# 主要程式邏輯
}
catch [System.NotSupportedException] {
Write-Output "不支援"
}
catch [System.IO.DirectoryNotFoundException] {
Write-Output "找不到資料夾"
}
catch {
Write-Output "通用的例外處理"
}
# 主要程式邏輯
}
catch [System.NotSupportedException] {
Write-Output "不支援"
}
catch [System.IO.DirectoryNotFoundException] {
Write-Output "找不到資料夾"
}
catch {
Write-Output "通用的例外處理"
}
沒有留言:
張貼留言