반응형
- Try, Catch, Finally
Try{
에러나는이상한문자
}
Catch{
Write-Host "이상한 문자가 있던데요?"
Write-Host $_
}finally{
Write-Host "에러와 상관없이 실행할꺼야!"
}
-
$_ : 에러 표출을 위해 사용
about_Try_Catch_Finally
About Try Catch Finally In this article --> SHORT DESCRIPTION Describes how to use the Try, Catch, and Finally blocks to handle terminating errors. LONG DESCRIPTION Use Try, Catch, and Finally blocks to respond to or handle terminating errors in scripts. T
docs.microsoft.com
반응형
'Windows 10 > PowerShell' 카테고리의 다른 글
PowerShell : IEX (문자열을 명령어로 실행하기) (0) | 2019.06.15 |
---|---|
PowerShell : 기초 명령어 (복사, 삭제, 이동) (0) | 2019.06.14 |
PowerShell : Array, 동적 배열 (0) | 2019.06.14 |
PowerShell : Switch (0) | 2019.06.14 |
PowerSehll : For, While, Break (0) | 2019.06.14 |