open-device 127.0.0.1
을 사용하여 원격 장치에 연결합니다. C#에서 어떻게 호출합니까? 이 코드 : 오류에C#에서 PowerShell 명령`open-device`를 어떻게 실행합니까?
PowerShell powerShell = PowerShell.Create();
PSCommand connect = new PSCommand();
connect.AddCommand("open-device");
powerShell.Commands = connect;
PSOutput = powerShell.Invoke()
결과 : 그러나
System.Management.Automation.CommandNotFoundException
: The termopen-device
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
System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
, 나는 Invoke
를 사용하여 get-service
명령을 실행 할 수 있어요.
,하지만 난 궁금 해서요 :'127.0.0.1' (일명,'localhost'은) 매우 원격으로 표시되지 않습니다 ...? – stakx