홈>
PowerShell에서 다음 명령을 실행하려고합니다
sc create StrongSwan binpath= "C:\Users\Kanishk\Desktop\Strong\Strong\stronswan\strongswan-5.6.3\src\charon-svc\charon-svc.exe"
.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
따라서 내 문제는 동일한 명령이 cmd에서 작동하지만 PowerShell에서는 작동하지 않는다는 것입니다. 어떤 이유가 있습니까?
- 답변 # 1
나는 이것도 만났다. 라인 1 문자 1에서 오류가 발생하는 것 같습니다. 그래서 나는 그것이 "sc"가 무엇인지 이해하지 못한다고 가정했습니다. 그래서 나는
sc create ..
를 변경sc.exe create ..
로 내 서비스에서 효과가있었습니다.