Book Image

Mastering Windows PowerShell Scripting

By : Brenton J.W. Blawat
Book Image

Mastering Windows PowerShell Scripting

By: Brenton J.W. Blawat

Overview of this book

Table of Contents (22 chapters)
Mastering Windows PowerShell Scripting
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting and restoring drifting configurations


PowerShell's integration with DSC provides the ability to evaluate the current state of the desired configuration on a system. After the configuration has been set on the system, you have the ability to check the current configuration using the get-dscconfiguration cmdlet. By simply calling get-dscconfiguration, the PowerShell cmdlet will evaluate what DSC items have been designated for the system, and how they were configured.

You may also want to determine if the system has drifted from the existing configuration set. Drifting happens when engineers modify a system, or additional software changes the configuration of that server. To test the existing configuration set, you can leverage the test-dscconfiguration cmdlet. The test-dscconfiguration cmdlet will either return True, which means that the system is configured as desired, or False, which means the system no longer adheres to the desired configuration for the system.

When you determine...