Writes DSC errors out as errors.
Write-DscError [-EventLogRecord] <EventLogRecord[]> [-PassThru] [<CommonParameters>]
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.
| 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 |
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.