Assembly: System.Management.Automation (in System.Management.Automation.dll)
An ErrorRecord object that describes the error condition.
When a cmdlet encounters a terminating error, call this method rather than simply throwing an exception. Calling this method allows the cmdlet to attach additional error record information that describes the condition that caused the terminating error. When this method is called, the Windows PowerShell runtime catches the error record and then starts shutting down the pipeline. For more information about error reporting and error records, see Windows PowerShell Error Reporting.
This method should not be used when errors occur where the cmdlet can continue processing records. To send error reports when nonterminating errors occur, call the WriteError method.
For more information about cmdlets, see Windows PowerShell Cmdlets.
Target PlatformsWindows Developer Preview, Windows Server Developer Preview
Send comments about this topic to Microsoft.