# Requires -Version 2 # Show-TryCatchFinally.ps1 # Demonstrates try/catch/finally in V2 # First, try something that will work Try { $I = 1 } Catch { " Caught a problem in try 1 " } Finally { " All done with 1st try " } # Now try something that fails $one = 1 # $zero=0 Try { $one / $zero } Catch { " Caught a problem in try 2 " } Finally { " All done with second try
Read More...
Read the complete post at http://pshscripts.blogspot.com/2008/11/catch-errorps1.html
Posted
Nov 23 2008, 08:56 AM
by
PowerShell Scripts