September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
1
Task/Exceptions/PowerShell/exceptions-1.psh
Normal file
1
Task/Exceptions/PowerShell/exceptions-1.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
throw "Any error message."
|
||||
1
Task/Exceptions/PowerShell/exceptions-2.psh
Normal file
1
Task/Exceptions/PowerShell/exceptions-2.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
throw [System.IO.FileNotFoundException] ".\temp.txt not found."
|
||||
12
Task/Exceptions/PowerShell/exceptions-3.psh
Normal file
12
Task/Exceptions/PowerShell/exceptions-3.psh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
try
|
||||
{
|
||||
Get-Content -Path .\temp.txt
|
||||
}
|
||||
catch [System.IO.FileNotFoundException]
|
||||
{
|
||||
Write-Host "File not found exception"
|
||||
}
|
||||
catch [System.Exception]
|
||||
{
|
||||
Write-Host "Other exception"
|
||||
}
|
||||
1
Task/Exceptions/PowerShell/exceptions-4.psh
Normal file
1
Task/Exceptions/PowerShell/exceptions-4.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
$Error[0] | Get-Member
|
||||
Loading…
Add table
Add a link
Reference in a new issue