Run Scripts: Prevent Script feature from sending all (i.e. optional) parameters
What I've noticed when using the new "Scripts" feature is that SCCM runs scripts with a very specific command format/syntax when calling a PowerShell script. Part of that is explicitly specifying every individual script parameter, regardless of whether it is mandatory.
I suppose that normally, this shouldn't be a problem, but besides being unnecessary and against the spirit of optional parameters, I've also been running into what I assume is a bug, where SCCM fails to properly pass all parameters. There seems to be a parameter limit, or more likely, a character limit to the command line SCCM runs on the client, causing parameters to be ignored or malformed when taken in by the script. On top of that there appears to be bugs with escaping certain characters and there's a known issue with sending spaces. I'll be submitting a bug report on this separately.
All of that has made troubleshooting parameterized scripts very painful, and SCCM forcefully sending more parameters than necessary only exacerbates the issue.