[lang-ref] 例外発生を判定 ( powershell )

It 'should handle exception' {
    # { ... } | Should -Throw

    { throw 'error' } | Should -Throw -ExceptionType 'System.Management.Automation.RuntimeException'
}