英文:
Powershell - Invoke-Command : Parameter set cannot be resolved using the specified named parameters
问题
[找不到任何相关或有效的答案,我检查了参数,它们是合法的]
我尝试用PowerShell运行一个可执行文件和相应的参数
这是代码:
Invoke-Command -FilePath "$execPath\xxxxxxxxxxxxxx.exe" -ArgumentList '--param1','param2'
这是错误信息:
Invoke-Command:无法使用指定的命名参数解析参数集。
在 xxxxxxxxx.ps1:18 字符:5
+ Invoke-Command -FilePath "$execPath\xxxxxxxxxxxxxx.exe" -Argument ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
感谢您为我解答这个问题。
英文:
[Could not find any relevant nor working answer, I checked the parameters, they are legit]
I try to run an executable with its respective parameters, but with powershell
here is the line:
Invoke-Command -FilePath "$execPath\xxxxxxxxxxxxxx.exe" -ArgumentList '--param1','param2'
and here is the error
Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
At xxxxxxxx.ps1:18 char:5
+ Invoke-Command -FilePath "$execPath\xxxxxxxxxxxxxx.exe" -Argument ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
thanks for enlighting me on this one
答案1
得分: 1
我已经让它像这样工作了
& "$execPath\xxxxxxxxxxxxxx.exe" "param1" "param2"
英文:
I got it working like this
& "$execPath\xxxxxxxxxxxxxx.exe" "param1" "param2"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论