- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2021-12-03T05:40:54+00:00","default:admin","admin")
#author("2021-12-03T05:54:40+00:00","default:admin","admin")
-[[例外について知りたかったことのすべて:https://docs.microsoft.com/ja-jp/powershell/scripting/learn/deep-dives/everything-about-exceptions?view=powershell-7.2]]
-[[【PowerShell】エラーハンドリング(Try-Catch)を使ってみる:https://soma-engineering.com/coding/powershell/error-handling/2018/07/03/]]
-基本的な書き方
try {
:
}
catch {
$e = $_.Exception
$errLine = $_.InvocationInfo.ScriptLineNumber
Write-Host -ForegroundColor Red $e at $errLine
}
finally {
:
}