StandardError
및 StandardOutput
속성에 액세스 할 때 Powershell의 Start-Process
명령에 버그가 있습니까? 나는 다음을 실행하면시작 프로세스의 표준 출력 및 오류 캡처
나는 더 출력을
$process = Start-Process -FilePath ping -ArgumentList localhost -NoNewWindow -PassThru -Wait
$process.StandardOutput
$process.StandardError
을 얻을하지만 출력을 파일로 리디렉션 있다면 어떤 이유로 설계되었습니다 방법 Start-Process
의 예상 된 결과
$process = Start-Process -FilePath ping -ArgumentList localhost -NoNewWindow -PassThru -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
이 특별한 경우에는 실제로 시작 프로세스가 필요합니까? ...'$ process = ping localhost'#는 출력을 프로세스 변수에 저장합니다. – mjsr
참. 나는 반환과 논쟁을 다루는 더 깨끗한 방법을 찾고 있었다. 나는 당신이 보여준대로 대본을 쓰는 것을 끝내었다. – jzbruno