Here’s a neat trick to make it easier to launch CMTrace (and smscfgrc.cpl) from the Run box and command line: Add the ConfigMgr client path to the PATH variable! Let’s do it via a configuration item:
Detection Script: To detect if it is already present, we get the existing contents of the PATH variable, break it down into an array, and then loop through all of the entries, looking for a match.
|
|
Remediation Script: To remediate the configuration, we combine the contents of the current PATH variable, add the CCM directory to it, and use the SetEnvironmentVariable method to save the changes.
We need to use SetEnvironmentVariable here instead of just setting $env:Path
directly so the changes are persisted beyond the current session.
|
|
Now you can do stuff like this without having to fully qualify the path or browsing to it!