Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Converting VBScript's Err Object Source Property


Windows PowerShell


Definition: Returns or sets the name of the object or application that originally generated the error.

Err Object Source Property

To determine which object or component was responsible for an error you can check the value of the Source property. This command assigns the Source property for the most recent error in the error collection to the variable $a:


$a = $error[0].source

When you run this command and then echo back the value of $a you should back something similar to the following:


System.Management.Automation


Return to the VBScript to Windows PowerShell home page

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.