Export (0) Print
Expand All

DSC Log Resource

Published: June 24, 2013

Updated: May 28, 2014

Applies To: Windows PowerShell 4.0

The Log resource in Windows PowerShell Desired State Configuration (DSC) provides a mechanism to write messages to the Microsoft-Windows-Desired State Configuration/Analytic event log.

Log [string] #ResourceName
{
    Message = [string]
    [ DependsOn = [string[]] ]
}

 

Property Description

Message

Indicates the message you want to write to the Microsoft-Windows-Desired State Configuration/Analytic event log.

DependsOn

Indicates that the configuration of another resource must run before this log message gets written. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is DependsOn = "[ResourceType]ResourceName" .

The following example shows how to include a message in the Microsoft-Windows-Desired State Configuration/Analytic event log.

noteNote:
If you run Test-DscConfiguration with this resource configured, it will always return False.


Log LogExample
{
    Message = "This message will appear in the Microsoft-Windows-Desired State Configuration/Analytic event log."
} 



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft