목표는 다음과 같은 오류를 피하기 위해 특정 파워 쉘 함수로 전달하기 전에 매개 변수가 실행될 수 있는지 확인하는 것입니다Powershell을 사용하여 경로를 실행할 수 있는지 여부를 확인하는 방법은 무엇입니까?
이& : The term 'c:\helloworld' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\functions\function.ps1:67 char:9
+ & $createServiceCommand install $serviceName
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (c:\helloworld:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
'helloworld'를 commandPath로 변경 한 후. 'C : \ Chocolatey \ lib \ chocolatey.0.9.8.24 \ tools \ chocolateyInstall \ NuGet.exe'이 스크립트를 실행하면'Command was found '가됩니다. 이 스크립트를 실행하면'Command was not found '가됩니다. 이 질문에 대한 답변입니다. 고맙습니다. 나는 대답을 받아 들일 것이고 upvote. – 030