-
I’ve been working with PowerShell’s error handling – trying to get a better handle on it. Yesterday, I looked at general error handling and discussed how to trap or catch an exception. By handling errors in your scripts, you make the script more production...
-
# 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 ...