# 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...