The Invoke-CMScript cmdlet invokes a PowerShell script in Microsoft System Center Configuration Manager. System Center Configuration Manager has an integrated ability to run Powershell scripts. The scripts simplify building custom tools to administer software and let you accomplish mundane tasks quickly, allowing you to get large jobs done more easily and more consistently. For more information, see Create and run PowerShell scripts from the Configuration Manager console.
unfortunately the Invoke-CMScript doesn’t allow to pass values to defined script params. if you want to do this, you have to invoke the script through the Configuration Manager console.