Powershell can't read my variable as start-process file path [duplicate]
问题 This question already has an answer here : Problems using local variables in a remote commands (1 answer) Closed last year . I'm trying to cleanup my script and I have ran into this issue. When I run Invoke-Command -ComputerName $Computer -ScriptBlock {Start-Process "c:\temp\openVPN\openvpn-install-2.4.8-I602-Win7.exe" I get no issues but when I set a variable so that script looks like this, $filepath = "c:\temp\openVPN\openvpn-install-2.4.8-I602-Win7.exe" Invoke-Command -ComputerName