Write-DscError

Writes DSC errors out as errors.

Syntax

Write-DscError [-EventLogRecord] <EventLogRecord[]> [-PassThru] [<CommonParameters>]

Description

The Local Configuration Manager (LCM) applies configuration in a separate process space as a background service which writes its errors to the Microsoft-Windows-DSC/Operational event log. This function is intended to be used with Get-DscError, and will write errors returned by that function as PowerShell errors.

Write-DscError is new in Carbon 2.0.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
EventLogRecord EventLogRecord[]

The error record to write out as an error.

true true (ByValue)
PassThru SwitchParameter

Return the event log record after writing an error.

false false False

Return Values

System.Diagnostics.Eventing.Reader.EventLogRecord.

EXAMPLE 1

Get-DscError | Write-DscError

Demonstrates how Write-DscError is intended to be used. Get-DscError gets the appropriate event objects that Write-DscError writes out.