Powershell: How to pass parameter with invoke-command and -filepath remotely?
问题 so there's a lot of similar topics to this I've found, but I can't find anything that correlates with my issue. invoke-command -computername $serverLocation -Credential $cred -filepath "C:\path\script2.ps1" -ArgumentList $configPath I am calling a for a script that is stored on my local machine to run on another server. Everything works as intended except for passing the "configPath" variable. This is how I initiate the script - . .\script1.ps1 -serverLocation 'serverNameHere' -username