我正在尝试在 PowerShell 中运行以下命令
sc create StrongSwan binpath= "C:\Users\Kanishk\Desktop\Strong\Strong\stronswan\strongswan-5.6.3\src\charon-svc\charon-svc.exe"
Run Code Online (Sandbox Code Playgroud)
我已经检查了 .exe 的路径是否正确,我也可以 cd 到它。作为参考,我正在关注这个:https : //wiki.strongswan.org/projects/strongswan/wiki/Charon-svc
我收到以下错误:
Set-Content : A positional parameter cannot be found that accepts argument 'binpath='.
At line:1 char:1
+ sc create NewService binpath= C:\Users\Kanishk\Desktop\Strong\Strong\ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Content], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetContentCommand
Run Code Online (Sandbox Code Playgroud)
所以我的问题是相同的命令在 cmd 上运行,但不在 PowerShell 上运行。有什么原因吗?