I am trying to have one of our APP servers to serve as a central PS script server. Basically to have all the scripts we use run from a central point.
I can run PS remotely etc but I'm having trouble passing parameters to a script the is running remotely.
For example to run this script locally:
Powershell.exe -file '.\Cleanup.ps1' -Path "D:\Shares\NZArchive" -Days 30 -Exclude "D:\Shares\NZArchive\CST"
When running remotely though, say using 'Invoke-Command' how do I pass those same parameters to the script?