< Back
Write-CDscError
Post
NAME Write-CDscError
SYNOPSIS
Writes DSC errors out as errors.
SYNTAX
Write-CDscError [-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-CDscError`, and will write errors returned by that function as PowerShell errors.
`Write-CDscError` is new in Carbon 2.0.
PARAMETERS
-EventLogRecord <EventLogRecord[]>
The error record to write out as an error.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Return the event log record after writing an error.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Diagnostics.Eventing.Reader.EventLogRecord
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-CDscError | Write-CDscError
Demonstrates how `Write-CDscError` is intended to be used. `Get-CDscError` gets the appropriate event objects that
`Write-CDscError` writes out.
RELATED LINKS
Get-CDscError
SYNOPSIS
Writes DSC errors out as errors.
SYNTAX
Write-CDscError [-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-CDscError`, and will write errors returned by that function as PowerShell errors.
`Write-CDscError` is new in Carbon 2.0.
PARAMETERS
-EventLogRecord <EventLogRecord[]>
The error record to write out as an error.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Return the event log record after writing an error.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Diagnostics.Eventing.Reader.EventLogRecord
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-CDscError | Write-CDscError
Demonstrates how `Write-CDscError` is intended to be used. `Get-CDscError` gets the appropriate event objects that
`Write-CDscError` writes out.
RELATED LINKS
Get-CDscError