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 $Computer -ScriptBlock {Start-Process -FilePath $filepath }
I receive the error
Cannot validate argument on parameter 'FilePath'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
Thanks!