/
power shell 명령 종료 상태 값(command exit status) 확인
power shell 명령 종료 상태 값(command exit status) 확인
파워쉘에서 외부 명령어를 실행하고 결과값을 확인해서 분기해야 할 경우가 있습니다.
powershell 도 Linux shell 처럼 $? 변수에 마지막 실행 값을 저장하므로 이 값을 확인해서 분기하면 됩니다.
bad-command if ($?) { Write-Output "success!" } else { Write-Output "Failed" }
Ref
, multiple selections available,
Related content
배시 셸 스크팁트 프로그래밍(bash shell script programming)
배시 셸 스크팁트 프로그래밍(bash shell script programming)
More like this
powershell 을 command line 에서 실행할 때 "'<' 연산자는 나중에 사용하도록 예약되어 있습니다". 에러
powershell 을 command line 에서 실행할 때 "'<' 연산자는 나중에 사용하도록 예약되어 있습니다". 에러
More like this
설정 파일 변경 사항을 반영하는 linux source 명령어 사용법
설정 파일 변경 사항을 반영하는 linux source 명령어 사용법
More like this
리눅스에서 프로세스 이름으로 프로세스 id 확인
리눅스에서 프로세스 이름으로 프로세스 id 확인
More like this
bash 자동 완성(auto completion) 기능으로 커맨드라인 생산성 높이기
bash 자동 완성(auto completion) 기능으로 커맨드라인 생산성 높이기
More like this
모든 docker 명령어가 응답하지 않고 hang 이 걸릴 경우 처리 방법
모든 docker 명령어가 응답하지 않고 hang 이 걸릴 경우 처리 방법
More like this