Book Image

Learning PowerShell DSC

By : James Pogran
Book Image

Learning PowerShell DSC

By: James Pogran

Overview of this book

Table of Contents (14 chapters)
Learning PowerShell DSC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Debugging and troubleshooting configuration script files


So, you ran a DSC configuration against a target node using either Start-DscConfiguration or a Pull Server and you want to look at the logs for its execution. Where do you go? If you ran it with Start-DscConfiguration and the Verbose parameter, then you will have a log in your console, but that goes away when you close your console, and you don't have this available with a Pull Server.

Worry not, for DSC provides a rich set of information from each operation it performs, although it's not always easy to access this information.

Using DSC event logs

Like most Windows software, DSC writes all event information to a Windows event log, which can be viewed with many applications, including Event Viewer and PowerShell.

DSC logs these events to the Microsoft-Windows-Dsc event log, which has the following channels:

  • Microsoft-Windows-Dsc/Operational

  • Microsoft-Windows-Dsc/Debug

  • Microsoft-Windows-Dsc/Analytic

Enabling verbose logging

The Analytic...