티스토리 뷰
[PowerShell] PowerShell 도움말 사용하기
PowerShell 도움말
PowerShell은 도움말을 통해 문법, 옵션, 파라미터 등 다양한 정보를 습득할 수 있습니다. PowreShell에는 갱신가능한 도움말이란 새 기능을 포함하고 있으며 업데이트 기능을 통해 도움말을 갱신하고 수정하며 확장된 도움말을 제공합니다.
PowerShell 도움말 업데이트
PowerShell은 도움말에 대한 온라인 업데이트를 지원하며 업데이트를 통해 도움말을 갱신합니다. 따라서 최신정보의 PowerShell 사용 도움말을 사용하고자 한다면 도움말을 업데이트 후 사용해야합니다. 도움말 업데이트 시 PowerShell을 관리자 권한으로 실행해야 오류메시지 없이 업데이트 가능합니다.
Update-Help |
PowerShell 도움말 확인
"Help Get-Command"와 "Get-Help Get-Command"를 통해 PowerShell 명령어에 대한 도움말을 확인할 수 있습니다.
[ Help Get-Content ]
도움말을 한 페이지씩 넘기며 확인할 수 있습니다.
[ Get-Help Get-Content ]
도움말을 한번에 볼 수 있습니다.
PowerShell 도움말을 통해 명령어 찾기
[ Help -Name '명령어' ] or [ Help '명령어' ]
Help -Name log Help log |
로그와 관련된 PowerShell 명령어 리스트를 확인할 수 있습니다.
PowerShell 도움말을 통해 명령어 찾기 - 고급
[ Get-Command -Noun "명령어" -Verb "액션" ]
이벤트(명령어)와 관련한 명령어를 찾고 이벤트로그를 가져오는(Get) 행위를 하는 명령어를 찾는다.
PS C:\WINDOWS\system32> Get-Command -Noun *Error* -Verb Get CommandType Name Version Source ----------- ---- ------- ------ Function Get-AppxLastError 2.0.0.0 Appx Cmdlet Get-WindowsErrorReporting 1.0 WindowsErrorReporting |
[ Get-Command "명령어" -CommandType "명령어 타입" ]
이벤트(명령어)와 관련한 명령어를 찾는 커맨드(명령어 타입)를 찾는다면 아래와 같이 검색할 수 있습니다.
PS C:\WINDOWS\system32> Get-Command *Error* -CommandType Cmdlet CommandType Name Version Source ----------- ---- ------- ------ Cmdlet Disable-WindowsErrorReporting 1.0 WindowsErrorReporting Cmdlet Enable-WindowsErrorReporting 1.0 WindowsErrorReporting Cmdlet Get-WindowsErrorReporting 1.0 WindowsErrorReporting Cmdlet Write-Error 3.1.0.0 Microsoft.PowerShell.Utility |