-
I'm trying to work out how to specify the Catch values for PowerShell V2 CTP3's Try/Catch stuff. Here's a simple divide by zero error that I'm trying to catch: <# .SYNOPSIS Demonstrates try/catch/finally in V2 .DESCRIPTION Shows a simple example of the try/catch/finally syntax introduced...
-
See this help file: about_Try_Catch_Finally $one=1 $zero=0 try{ $one/$zero } catch [System.DivideByZeroException]{ #"The first Catch script block handles System.DivideByZeroException exceptions" "Attempted to divide by zero" } catch { "the second Catch script block handles any...
-
This is very good info, but I'm lost when it comes to dealing with COM object exceptions inside PowerShell. Some are rather simple, for example, I've registered a DLL (e.g. KiXtart.DLL which comes with KiXtart 4.60). I can invoke the interface as an object in VBScript and JScript fine. It works...
-
By Steven Murawski To deal with this issue and to provide additional output options, PowerShell employs the concept of streams. There are three additional streams (other than the primary pipeline stream) available in PowerShell – Verbose, Warning, ... Read More
-
I believe I have a useful script for new powershell scripters. It's a template/wrapper for a script that handles error trapping and event logging. It seems to work but probably is inelegant. Feel free to share this or anything you ... Read More
Posted to
General
(Forum)
by
ps2
on
11-04-2009
Filed under: Error Handling, Event Logging
-
Jeremy lead a discussion at the recent PowerShell UK User Group hosted by Richard Siddaway on error handling. Read more