Pass script parameters with Invoke-CMScript
Allow the Invoke-CMScript to pass script parameters. This could be done with a ScriptParameter hashtable similar to how Invoke-CMReport functions.


Parameter support for Invoke-CMScript will be in the upcoming TP 2008 release.
A newly added -ScriptParameter parameter will let you specify a hashtable of key/value pairs that will be added to the script.
2 comments
-
Anonymous commented
What is the point of the built in cmdlets if we have do all this through wmi on the site server just run the script with a few paramaters?
-
Josh commented
Hi Dan, you can use this function to pass params to a Invoke-CMSCript:
https://github.com/joshburkard/SCCM/blob/master/Invoke-SCCMScript.ps1