For the complete documentation index, see llms.txt. This page is also available as Markdown.

Write-PSUError

Writes an error to the error stream in PSU jobs.

SYNOPSIS

Writes an error to the error stream in PSU jobs.

SYNTAX

Write-PSUError -ErrorRecord <ErrorRecord> [<CommonParameters>]

DESCRIPTION

Writes an error to the error stream in PSU jobs.

EXAMPLES

Example 1

try {
    throw "Error"
} catch {
    Write-PSUError $_
}

Throws an exception but does not fail the job. The error will be displayed in the PSU error log.

PARAMETERS

-ErrorRecord

The error record to display in the log.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

System.Management.Automation.ErrorRecord

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?