New Capability

\n”); document.write(“\n”); document.write(“

DSC has a new debugging mode that helps with troubleshooting by making it possible to interact with scripts being run by DSC, as they are being applied. When this mode is enabled, as the machine applies the configuration, progress will stop at the first script action to wait for a remote connection to open. Once connected, the person doing the troubleshooting can interact with the session as well as use breakpoints to debug.

\n”); document.write(“\n”); document.write(“

What is the purpose of this feature?

\n”); document.write(“\n”); document.write(“

Customers have requested additional tools for troubleshooting. The new debugging mode, combined with existing tools, provides an improved troubleshooting experience.

\n”); document.write(“\n”); document.write(“

What is the easiest way to test it?

\n”); document.write(“\n”); document.write(“

To test the new debug feature you will need to enable ResourceScriptBreakAll debug mode, apply a configuration, and then connect to the session and interact with it. The examples below provide a simple configuration for testing. It will be easier to test this with modules that are available from the gallery, rather than those built in to Windows.

\n”); document.write(“\n”); document.write(“

This approach is compatible with the April 2015 WMF5 Preview. Set ResourceScriptBreakAll mode:

The last three lines in the output example above provide a reference to connect with the session from a new instance of PowerShell ISE. In the first line, replace with (Get-Credential) to get an interactive prompt for username and password. Make sure you log in with an account that is a local administrator.

After you run Debug-Runspace -ID (Number), you should see the module file open in ISE. Set a breakpoint and run the function. You should be able to interact with the environment to verify variables, environmental factors like name resolution, etc.