강좌 / 팁

Powershell 스크립트 작성 할때 많이 사용하는 명령어

2024.08.25 22:23

Nic네임 조회:641 추천:11

클라이언트 OS 자동화를 기준으로 명령어를 뽑았습니다. 몰라도 크게 상관없는 유용한 명령어도 포함되어 있습니다.

번역된 페이지라 이해가 안 될 수 있습니다. 꼭 예제를 실행해보세요.

스크립트용 명령어라서 단일 명령어로 사용하기엔 적합하지 않습니다.

 

1. 매개변수로 입력한 경로가 존재하는지 확인 하는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/test-path?view=powershell-7.4

 

2. 경로의 지정된 부분을 반환해주는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/split-path?view=powershell-7.4

 

3. 경로와 자식 경로를 단일 경로로 결합하는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/join-path?view=powershell-7.4

 

4. 폴더 파일 레지스트리키와 같은 항목을 만드는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.4

 

5. 파일의 속성을 설정하거나 레지스트리 항목을 만드는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7.4

 

6. 파일의 내용을 가져오는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/get-content?view=powershell-7.4

 

7. 파일의 내용을 변경하거나 새 파일을 만드는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/set-content?view=powershell-7.4

 

8. 문자열 및 파일에서 텍스트를 찾는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.4

 

9. 콘솔에 출력하는 명령어 (echo와 비슷한 명령어)

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.utility/write-host?view=powershell-7.4

 

10. 프로그램을 실행하는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.4

 

아래 명령어는 알면 유용하지만 몰라도 상관 없는 명령어입니다.

-----------------------------------------------------------------------------------------------------------

 

1-1. foreach 문을 파이프라인을 통해서 간단하게 구현하는 명령어 (이해하기 힘들수도 있습니다.)

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.4

 

1-2. 조건에 맞는 개체만 선택하는 명령어 (foreach문과 비슷합니다.)

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.4

 

2. 개체의 속성들 중 원하는 항목만 표시하는 명령어

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.utility/select-object?view=powershell-7.4

번호 제목 글쓴이 조회 추천 등록일
[공지] 강좌 작성간 참고해주세요 gooddew - - -
4511 소프트웨어| 확장자 연동 우클릭 메뉴 생성기 v8 [12] update 무월 509 21 10-01
4510 소프트웨어| 응답파일(unattend.xml) 교체 및 수정 - ChangeUnattend v2 [21] 무월 1219 50 09-26
4509 윈 도 우| Windows 11 작업 관리자가 곧 컴퓨터에 어떤 종류의 SSD가 ... [2] VᴇɴᴜꜱGɪ 1298 8 09-23
4508 윈 도 우| Windows 터미널 사용 방법 및 유용한 용도 [1] VᴇɴᴜꜱGɪ 506 4 09-23
4507 [Tip] Ventoy 테마 폰트 에 대하여.. [5] 메인보드 1079 18 09-16
4506 Windows 11에서 드라이브 활동을 모니터링하는 방법 [1] VᴇɴᴜꜱGɪ 653 3 09-15
4505 소프트웨어| install.wim 이미지 추출 - WimInfo [18] 무월 1866 58 09-13
4504 오직 배치파일로만 VHD관리해보기.. [7] 수채화 962 22 09-09
4503 소프트웨어| WinNTSetup - VHD(윈도우 설치) 활용 방법 [13] 무월 1362 54 09-08
4502 레인미터와 HWiNFO 연동하기 [5] 수채화 761 21 09-08
4501 Windows 11 버전 24H2의 작업 표시줄 및 시작 메뉴의 새로... [2] VᴇɴᴜꜱGɪ 1639 4 09-07
4500 Windows 11 버전 24H2 롤백 및 제거 방법 VᴇɴᴜꜱGɪ 1342 9 09-05
4499 "이 앱을 찾을 수 없습니다" Windows 시작 레지... VᴇɴᴜꜱGɪ 1152 1 09-03
4498 Windows 11 버전 24H2 다운로드 및 설치 방법 VᴇɴᴜꜱGɪ 2225 1 09-03
4497 Windows 11 및 10의 문제를 해결하기 위해 Windows 보안 앱... VᴇɴᴜꜱGɪ 1187 4 09-02
4496 배치 파일 색상 팔레트 [11] 지후빠 1081 30 09-01
4495 배치 파일 for문에서 diskpart 실행 [6] sunshine 823 18 09-01
4494 배치파일 작은 팁 2가지 [15] sunshine 1722 34 08-26
» Powershell 스크립트 작성 할때 많이 사용하는 명령어 [2] Nic네임 641 11 08-25
4492 빠르게 Powershell 배우는 방법 [7] Nic네임 2335 25 08-07
XE1.11.6 Layout1.4.8