我正在运行以下 powershell 命令:
$cmd = "xxx.exe"
Invoke-Command -ComputerName localhost {Invoke-Expression $cmd}
但是我得到了错误:
Cannot bind argument to parameter 'Command' because it is null.
+ CategoryInfo : InvalidData: (:) [Invoke-Expression], ParameterB
indingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M
icrosoft.PowerShell.Commands.InvokeExpressionCommand