Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 1.0 » Write-Error

Write-Error - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Write-Error

Description
Write an object to the error pipeline.

Usage


Options


Example(s)
Force a single error using Get-Date and then display the $error[0] variable:

PS C:\>Get-Date | foreach-Object {Write-Error "Demo Error" -errorID T1 -targetobject $_}
PS C:\>$error[0]