PowerShell의 숙련도를 평가하기 위해 고안된 실험에서 초급자와 전문가라는 두 가지 IT 전문가 그룹이 먼저 컴퓨터에 액세스하지 않고 서면 검사를 받았습니다. 놀랍게도, 테스트 점수는 두 그룹 모두에서 비슷한 기술을 나타냈습니다. 그런 다음 후속 테스트를 관리하여 첫 번째 테스트를 미러링했지만 한 가지 주요 차이점이 있습니다. 참가자는 PowerShell이 장착된 오프라인 컴퓨터에 액세스할 수 있었습니다. 결과는 이번에는 두 그룹 사이에 상당한 기술 격차를 보였습니다.
두 평가 간에 관찰된 결과에 기여한 요인은 무엇인가요?
전문가들은 항상 답을 알지는 못하지만 답을 파악하는 방법을 알고 있습니다.
두 테스트의 결과에서 관찰된 결과는 전문가가 수천 개의 PowerShell 명령을 기억하지 않기 때문입니다. 대신 PowerShell 내에서 도움말 시스템을 사용하여 필요한 경우 명령을 검색하고 사용하는 방법을 배울 수 있습니다.
PowerShell을 통해 도움말 시스템에 능숙해지는 것이 성공의 열쇠입니다.
PowerShell의 제작자인 제프리 스노버(Jeffrey Snover)가 여러 차례 비슷한 이야기를 나누는 것을 들었습니다.
발견 가능성
PowerShell에서 cmdlet은 "CMD-let" 아니라 "command-let" 으로 발음되는 컴파일된 명령입니다. cmdlet에 대한 명명 규칙은 쉽게 검색할 수 있도록 단수 동사-명사 형식을 따릅니다. 예를 들어 Get-Process 실행 중인 프로세스를 결정하는 cmdlet이며, Get-Service 서비스 목록을 검색하는 cmdlet입니다. 스크립트 cmdlet이라고도 하는 함수 및 별칭은 이 책의 뒷부분에서 설명하는 다른 유형의 PowerShell 명령입니다. "PowerShell 명령" 용어는 cmdlet, 함수 또는 별칭에 관계없이 PowerShell의 모든 명령을 설명합니다.
ping.exe 및 ipconfig.exe같은 기존 명령줄 프로그램과 같은 PowerShell에서 운영 체제 네이티브 명령을 실행할 수도 있습니다.
PowerShell의 세 가지 핵심 cmdlet
Get-HelpGet-Command-
Get-Member(3장에서 설명)
"PowerShell에서 명령이 무엇인지 어떻게 알 수 있나요?" 자주 묻습니다.
Get-Help 및 Get-Command 모두 PowerShell에서 명령을 검색하고 이해하기 위한 귀중한 리소스입니다.
도움말 가져오기
PowerShell의 도움말 시스템에 대해 가장 먼저 알아야 할 것은 Get-Help cmdlet을 사용하는 방법입니다.
Get-Help은(는) 다목적 명령으로, 명령을 찾고 나면 이를 사용하는 방법을 배우는 데 도움을 줍니다.
명령을 찾는 데 Get-Help를 사용할 수 있지만, Get-Command과 비교했을 때는 좀 더 간접적인 방식으로 할 수 있습니다.
Get-Help 사용하여 명령을 찾는 경우 처음에는 입력에 따라 명령 이름에 대한 와일드카드 검색을 수행합니다. 일치하는 항목을 찾을 수 없는 경우 시스템의 모든 PowerShell 도움말 문서에서 포괄적인 전체 텍스트 검색을 수행합니다. 결과도 찾지 못하면 오류가 반환됩니다.
Get-Help 사용하여 Get-Help cmdlet에 대한 도움말 콘텐츠를 보는 방법은 다음과 같습니다.
Get-Help -Name Get-Help
PowerShell 버전 3.0부터 도움말 콘텐츠는 운영 체제와 함께 미리 설치되지 않습니다.
Get-Help 처음으로 실행하면 PowerShell 도움말 파일을 컴퓨터에 다운로드할지 묻는 메시지가 표시됩니다.
Y를 눌러 예로 응답하면 Update-Help cmdlet이 실행되고 도움말 콘텐츠가 다운로드됩니다.
Do you want to run Update-Help?
The Update-Help cmdlet downloads the most current Help files for Windows
PowerShell modules, and installs them on your computer. For more information
about the Update-Help cmdlet, see
https:/go.microsoft.com/fwlink/?LinkId=210614.
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):
이 메시지가 수신되지 않으면 관리자 권한으로 실행되는 관리자 권한 PowerShell 세션에서 Update-Help 실행합니다.
업데이트가 완료되면 도움말 문서가 표시됩니다.
잠시 시간을 내어 컴퓨터에서 예제를 실행하고, 출력을 검토하고, 도움말 시스템에서 정보를 구성하는 방법을 확인합니다.
- 이름
- 개요
- 통사론
- 설명
- 관련 링크
- 비고
출력을 검토할 때 도움말 문서에는 방대한 양의 정보가 포함되어 있는 경우가 많으며 기본적으로 표시되는 내용이 전체 도움말 문서가 아니라는 점을 명심하세요.
매개 변수
PowerShell에서 명령을 실행할 때 명령에 추가 정보 또는 입력을 제공해야 할 수 있습니다. 매개 변수를 사용하면 명령의 동작을 변경하는 옵션 및 인수를 지정할 수 있습니다. 각 도움말 문서의 구문 섹션에서는 명령에 사용 가능한 매개 변수를 간략하게 설명합니다.
Get-Help 명령에 대한 전체 도움말 문서 또는 하위 집합을 반환하도록 지정할 수 있는 몇 가지 매개 변수가 있습니다.
Get-Help사용 가능한 모든 매개 변수를 보려면 다음 예제와 같이 도움말 문서의 SYNTAX 섹션을 참조하세요.
...
SYNTAX
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] [-Full]
[-Functionality <System.String[]>] [-Path <System.String>] [-Role
<System.String[]>] [<CommonParameters>]
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] -Detailed
[-Functionality <System.String[]>] [-Path <System.String>] [-Role
<System.String[]>] [<CommonParameters>]
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] -Examples
[-Functionality <System.String[]>] [-Path <System.String>] [-Role
<System.String[]>] [<CommonParameters>]
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] [-Functionality
<System.String[]>] -Online [-Path <System.String>] [-Role
<System.String[]>] [<CommonParameters>]
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] [-Functionality
<System.String[]>] -Parameter <System.String> [-Path <System.String>]
[-Role <System.String[]>] [<CommonParameters>]
Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider
| General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
Filter | ExternalScript | All | DefaultHelp | Workflow | DscResource |
Class | Configuration}] [-Component <System.String[]>] [-Functionality
<System.String[]>] [-Path <System.String>] [-Role <System.String[]>]
-ShowWindow [<CommonParameters>]
...
매개 변수 집합
구문 섹션을 Get-Help에 대해 검토할 때, 정보가 여섯 번 반복되는 것처럼 보입니다. 이러한 각 블록은 개별 매개 변수 집합으로, Get-Help cmdlet은 6개의 고유한 매개 변수 집합을 제공합니다. 자세히 살펴보면 각 매개 변수 집합에 하나 이상의 고유 매개 변수가 포함되어 다른 매개 변수와 다르게 표시됩니다.
매개 변수 집합은 상호 배타적입니다. 하나의 매개 변수 집합에만 존재하는 고유 매개 변수를 지정하면 PowerShell은 해당 매개 변수 집합에 포함된 매개 변수를 사용하도록 제한합니다.
예를 들어 다른 매개 변수 집합에 속하기 때문에 전체 및 Get-Help 매개 변수를 함께 사용할 수 없습니다.
다음 각 매개 변수는 Get-Help cmdlet에 대해 설정된 다른 매개 변수에 속합니다.
- 전체
- 상세한
- 예시
- 온라인
- 매개 변수
- 쇼윈도
명령 구문
PowerShell을 접하는 경우 SYNTAX 섹션에서 대괄호와 꺾쇠 괄호로 특징지어지는 비밀 정보를 이해하는 것은 압도적일 수 있습니다. 그러나 이러한 구문 요소를 학습하는 것은 PowerShell을 능숙하게 하는 데 필수적입니다. PowerShell 도움말 시스템을 자주 사용할수록 모든 뉘앙스를 더 쉽게 기억할 수 있습니다.
Get-EventLog cmdlet의 구문을 봅니다.
Get-Help Get-EventLog
다음 출력은 도움말 문서의 관련 부분을 보여줍니다.
...
SYNTAX
Get-EventLog [-LogName] <System.String> [[-InstanceId]
<System.Int64[]>] [-After <System.DateTime>] [-AsBaseObject] [-Before
<System.DateTime>] [-ComputerName <System.String[]>] [-EntryType {Error
| Information | FailureAudit | SuccessAudit | Warning}] [-Index
<System.Int32[]>] [-Message <System.String>] [-Newest <System.Int32>]
[-Source <System.String[]>] [-UserName <System.String[]>]
[<CommonParameters>]
Get-EventLog [-AsString] [-ComputerName <System.String[]>] [-List]
[<CommonParameters>]
...
구문 정보에는 대괄호 쌍([])이 포함됩니다. 사용량에 따라 이러한 대괄호는 서로 다른 두 가지 용도로 사용됩니다.
- 대괄호로 묶인 요소는 선택 사항입니다.
- 데이터 형식 뒤의 빈 대괄호 집합(예:
<string[]>)은 매개 변수가 배열 또는 컬렉션 개체로 전달된 여러 값을 허용할 수 있음을 나타냅니다.
위치 매개 변수
일부 cmdlet은 위치 매개 변수를 허용하도록 설계되었습니다. 위치 매개 변수를 사용하면 매개 변수의 이름을 지정하지 않고 값을 제공할 수 있습니다. 매개 변수를 위치적으로 사용하는 경우 명령줄의 올바른 위치에 해당 값을 지정해야 합니다. 명령 도움말 문서의 PARAMETERS 섹션에서 매개 변수에 대한 위치 정보를 찾을 수 있습니다. 매개 변수 이름을 명시적으로 지정하는 경우 임의의 순서로 매개 변수를 사용할 수 있습니다.
Get-EventLog cmdlet의 경우 첫 번째 매개 변수 집합의 첫 번째 매개 변수는 LogName입니다.
LogName 대괄호로 묶어 위치 매개 변수임을 나타냅니다.
Get-EventLog [-LogName] <System.String>
LogName 위치 매개 변수이므로 이름 또는 위치로 지정할 수 있습니다. 매개 변수 이름 다음에 있는 꺾쇠 괄호에 따라 LogName 값은 단일 문자열이어야 합니다. 매개 변수 이름과 데이터 형식을 모두 묶는 대괄호가 없는 경우 logName 이 특정 매개 변수 집합 내에서 필수 매개 변수임을 나타냅니다.
해당 매개 변수 집합의 두 번째 매개 변수는 InstanceId. 매개 변수 이름과 데이터 형식은 모두 대괄호로 완전히 묶어 있으므로 InstanceId 선택적 매개 변수임을 나타냅니다.
[[-InstanceId] <System.Int64[]>]
또한 InstanceId 고유한 대괄호 쌍이 있으며 이는 LogName 매개 변수와 유사한 위치 매개 변수임을 나타냅니다. 데이터 형식에 따라 빈 대괄호 집합은 InstanceId 여러 값을 수락할 수 있음을 의미합니다.
매개 변수 전환
값이 필요하지 않은 매개 변수를 switch 매개 변수라고 합니다. 매개 변수 이름 다음에 데이터 형식이 없으므로 스위치 매개 변수를 쉽게 식별할 수 있습니다. switch 매개 변수를 지정하면 해당 값이 true. switch 매개 변수를 지정하지 않으면 해당 값이 false.
두 번째 매개 변수 집합에는 switch 매개 변수인 List 매개 변수가 포함됩니다. List 매개 변수를 지정하면 로컬 컴퓨터에서 이벤트 로그 목록이 반환됩니다.
[-List]
구문에 대한 간소화된 접근 방식
일반 영어를 제외하고 일부 명령에 대한 비밀 명령 구문과 동일한 정보를 가져오는 보다 사용자에게 친숙한 방법이 있습니다. PowerShell은 Get-Help 매개 변수와 함께 사용할 때 전체 도움말 문서를 반환하므로 명령의 사용량을 더 쉽게 이해할 수 있습니다.
Get-Help -Name Get-Help -Full
잠시 시간을 내어 컴퓨터에서 예제를 실행하고, 출력을 검토하고, 도움말 시스템에서 정보를 구성하는 방법을 확인합니다.
- 이름
- 개요
- 통사론
- 설명
- 매개 변수
- 입력
- 출력
- 노트
- 예제
- 관련 링크
cmdlet을 사용하여 Get-Help 매개 변수를 지정하면 출력에 몇 가지 추가 섹션이 포함됩니다. 이러한 섹션에서는 PARAMETERS 각 매개 변수에 대한 자세한 설명을 제공합니다. 그러나 이 정보의 범위는 조사 중인 특정 명령에 따라 달라집니다.
...
-Detailed <System.Management.Automation.SwitchParameter>
Adds parameter descriptions and examples to the basic help display.
This parameter is effective only when the help files are installed
on the computer. It has no effect on displays of conceptual ( About_
) help.
Required? true
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Examples <System.Management.Automation.SwitchParameter>
Displays only the name, synopsis, and examples. This parameter is
effective only when the help files are installed on the computer. It
has no effect on displays of conceptual ( About_ ) help.
Required? true
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Full <System.Management.Automation.SwitchParameter>
Displays the entire help article for a cmdlet. Full includes
parameter descriptions and attributes, examples, input and output
object types, and additional notes.
This parameter is effective only when the help files are installed
on the computer. It has no effect on displays of conceptual ( About_
) help.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
...
이전 명령을 실행하여 Get-Help 명령에 대한 도움말을 표시했을 때 출력이 너무 빨리 스크롤되어 읽을 수 없는 것으로 나타났습니다.
PowerShell 콘솔, Windows 터미널 또는 VS Code를 사용하고 도움말 문서를 확인해야 하는 경우 help 함수가 유용할 수 있습니다.
Get-Help의 출력을 more.com로 파이프하여 도움말 콘텐츠를 한 번에 한 페이지씩 표시합니다. 더 나은 사용자 경험을 제공하고 입력해야 할 내용이 적기 때문에 help cmdlet 대신 Get-Help 함수를 사용할 것을 추천합니다.
비고
ISE는 more.com사용을 지원하지 않으므로 help 실행은 Get-Help동일한 방식으로 작동합니다.
컴퓨터의 PowerShell에서 다음 명령을 각각 실행합니다.
Get-Help -Name Get-Help -Full
help -Name Get-Help -Full
help Get-Help -Full
이전 명령을 실행할 때 출력의 변형을 관찰했나요?
이전 예제에서 첫 번째 줄은 Get-Help cmdlet을 사용하고, 두 번째 줄은 help 함수를 사용하고, 세 번째 줄은 함수를 사용하는 동안 help 매개 변수를 생략합니다.
Name 위치 매개 변수이므로 세 번째 예제에서는 매개 변수의 이름을 명시적으로 나타내는 대신 해당 위치를 활용합니다.
차이점은 마지막 두 명령이 출력을 한 번에 한 페이지씩 표시한다는 것입니다.
help 함수를 사용하는 경우 스페이스바 를 눌러 콘텐츠의 다음 페이지를 표시하거나 Q 를 눌러 종료하십시오. PowerShell에서 대화형으로 실행되는 명령을 종료해야 하는 경우 Ctrl+C누릅니다.
특정 매개 변수에 대한 정보를 빠르게 찾으려면 매개 변수 매개 변수를 사용합니다. 이 방법은 전체 도움말 문서가 아닌 매개 변수 관련 정보만 포함하는 콘텐츠를 반환합니다. 이 방법은 특정 매개 변수에 대한 정보를 찾는 가장 쉬운 방법입니다.
다음 예제에서는 help 매개 변수와 함께 함수를 사용하여 Get-Help 매개 변수에 대한 도움말 문서에서 정보를 반환합니다.
help Get-Help -Parameter Name
도움말 정보는 Name 매개 변수가 위치이며 위치 지정 시 첫 번째 위치(위치 0)에 지정되어야 임을 보여 줍니다.
-Name <System.String>
Gets help about the specified command or concept. Enter the name of a
cmdlet, function, provider, script, or workflow, such as `Get-Member`,
a conceptual article name, such as `about_Objects`, or an alias, such
as `ls`. Wildcard characters are permitted in cmdlet and provider
names, but you can't use wildcard characters to find the names of
function help and script help articles.
To get help for a script that isn't located in a path that's listed in
the `$env:Path` environment variable, type the script's path and file
name.
If you enter the exact name of a help article, `Get-Help` displays the
article contents.
If you enter a word or word pattern that appears in several help
article titles, `Get-Help` displays a list of the matching titles.
If you enter any text that doesn't match any help article titles,
`Get-Help` displays a list of articles that include that text in their
contents.
The names of conceptual articles, such as `about_Objects`, must be
entered in English, even in non-English versions of PowerShell.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? true
Name 매개 변수에는 매개 변수 이름 옆에 있는 <String> 데이터 형식으로 식별되는 문자열 값이 필요합니다.
도움말 문서의 하위 집합을 반환하기 위해 Get-Help 사용하여 지정할 수 있는 몇 가지 다른 매개 변수가 있습니다. 작동 방식을 확인하려면 컴퓨터에서 다음 명령을 실행합니다.
Get-Help -Name Get-Command -Full
Get-Help -Name Get-Command -Detailed
Get-Help -Name Get-Command -Examples
Get-Help -Name Get-Command -Online
Get-Help -Name Get-Command -Parameter Noun
Get-Help -Name Get-Command -ShowWindow
일반적으로 help <command name> 또는 Online 매개 변수와 함께 사용합니다. 예제에만 관심이 있는 경우 Examples 매개 변수를 사용합니다. 특정 매개 변수에만 관심이 있는 경우 매개 변수 매개 변수를 사용합니다.
ShowWindow 매개 변수를 사용하면 별도의 검색 가능한 창에 도움말 콘텐츠가 표시됩니다. 모니터가 여러 개 있는 경우 해당 창을 다른 모니터로 이동할 수 있습니다. 그러나 ShowWindow 매개 변수에는 전체 도움말 문서를 표시하지 못할 수 있는 알려진 버그가 있습니다. ShowWindow 매개 변수에는 GUI(그래픽 사용자 인터페이스)가 있는 운영 체제도 필요합니다. Windows Server Core에서 사용하려고 하면 오류가 반환됩니다.
인터넷에 액세스할 수 있는 경우 Online 매개 변수를 대신 사용할 수 있습니다. Online 매개 변수는 기본 웹 브라우저에서 도움말 문서를 엽니다. 온라인 콘텐츠는 가장 최신의 콘텐츠입니다. 브라우저를 사용하면 도움말 콘텐츠를 검색하고 다른 관련 도움말 문서를 볼 수 있습니다.
비고
Online 매개 변수는 에 대한 기사에서 지원되지 않습니다.
help Get-Command -Online
Get-Help 사용하여 명령 찾기
Get-Help명령을 찾으려면 * 매개 변수 값에 대한 별표() 와일드카드 문자로 둘러싸인 검색어를 지정합니다. 다음 예제에서는 Name 매개 변수를 위치적으로 사용합니다.
help *process*
Name Category Module Synops
---- -------- ------ ------
Enter-PSHostProcess Cmdlet Microsoft.PowerShell.Core Con...
Exit-PSHostProcess Cmdlet Microsoft.PowerShell.Core Clo...
Get-PSHostProcessInfo Cmdlet Microsoft.PowerShell.Core Get...
Debug-Process Cmdlet Microsoft.PowerShell.M... Deb...
Get-Process Cmdlet Microsoft.PowerShell.M... Get...
Start-Process Cmdlet Microsoft.PowerShell.M... Sta...
Stop-Process Cmdlet Microsoft.PowerShell.M... Sto...
Wait-Process Cmdlet Microsoft.PowerShell.M... Wai...
Invoke-LapsPolicyProcessing Cmdlet LAPS Inv...
ConvertTo-ProcessMitigationPolicy Cmdlet ProcessMitigations Con...
Get-ProcessMitigation Cmdlet ProcessMitigations Get...
Set-ProcessMitigation Cmdlet ProcessMitigations Set...
이 시나리오에서는 * 와일드카드 문자를 추가할 필요가 없습니다.
Get-Help 제공한 값과 일치하는 명령을 찾을 수 없는 경우 해당 값에 대한 전체 텍스트 검색을 수행합니다. 다음 예제에서는 각 *끝에 process 와일드카드 문자를 지정하는 것과 동일한 결과를 생성합니다.
help process
값 내에 와일드카드 문자를 지정하면 Get-Help 제공한 패턴과 일치하는 명령만 검색합니다. 전체 텍스트 검색을 수행하지 않습니다. 다음 명령은 결과를 반환하지 않습니다.
help pr*cess
PowerShell은 대시를 매개 변수 이름으로 해석하기 때문에 대시를 따옴표로 묶지 않고 대시로 시작하는 값을 지정하면 오류를 생성합니다.
Get-Help cmdlet에 대해 이러한 매개 변수 이름이 없습니다.
help -process
-process끝나는 명령을 검색하려는 경우 값의 시작 부분에 * 추가해야 합니다.
help *-process
Get-Help사용하여 PowerShell 명령을 검색하는 경우 너무 구체적이기보다는 모호하게 하는 것이 좋습니다.
이전에 process 검색한 결과 이름에 process 포함된 명령만 반환되었습니다. 그러나 processes검색하는 경우 명령 이름에 대한 일치 항목을 찾을 수 없습니다. 앞에서 설명한 것처럼 도움말에서 일치하는 항목을 찾지 못하면 시스템의 모든 도움말 문서에 대한 포괄적인 전체 텍스트 검색을 수행하고 해당 결과를 반환합니다. 이러한 유형의 검색은 사용자와 관련이 없는 정보를 포함하여 예상보다 많은 결과를 생성하는 경우가 많습니다.
help processes
Name Category Module Synops
---- -------- ------ ------
Disconnect-PSSession Cmdlet Microsoft.PowerShell.Core Dis...
Enter-PSHostProcess Cmdlet Microsoft.PowerShell.Core Con...
ForEach-Object Cmdlet Microsoft.PowerShell.Core Per...
Get-PSHostProcessInfo Cmdlet Microsoft.PowerShell.Core Get...
Get-PSSessionConfiguration Cmdlet Microsoft.PowerShell.Core Get...
New-PSSessionOption Cmdlet Microsoft.PowerShell.Core Cre...
New-PSTransportOption Cmdlet Microsoft.PowerShell.Core Cre...
Out-Host Cmdlet Microsoft.PowerShell.Core Sen...
Start-Job Cmdlet Microsoft.PowerShell.Core Sta...
Where-Object Cmdlet Microsoft.PowerShell.Core Sel...
Debug-Process Cmdlet Microsoft.PowerShell.M... Deb...
Get-Process Cmdlet Microsoft.PowerShell.M... Get...
Get-WmiObject Cmdlet Microsoft.PowerShell.M... Get...
Start-Process Cmdlet Microsoft.PowerShell.M... Sta...
Stop-Process Cmdlet Microsoft.PowerShell.M... Sto...
Wait-Process Cmdlet Microsoft.PowerShell.M... Wai...
Clear-Variable Cmdlet Microsoft.PowerShell.U... Del...
Convert-String Cmdlet Microsoft.PowerShell.U... For...
ConvertFrom-Csv Cmdlet Microsoft.PowerShell.U... Con...
ConvertFrom-Json Cmdlet Microsoft.PowerShell.U... Con...
ConvertTo-Html Cmdlet Microsoft.PowerShell.U... Con...
ConvertTo-Xml Cmdlet Microsoft.PowerShell.U... Cre...
Debug-Runspace Cmdlet Microsoft.PowerShell.U... Sta...
Export-Csv Cmdlet Microsoft.PowerShell.U... Con...
Export-FormatData Cmdlet Microsoft.PowerShell.U... Sav...
Format-List Cmdlet Microsoft.PowerShell.U... For...
Format-Table Cmdlet Microsoft.PowerShell.U... For...
Get-Unique Cmdlet Microsoft.PowerShell.U... Ret...
Group-Object Cmdlet Microsoft.PowerShell.U... Gro...
Import-Clixml Cmdlet Microsoft.PowerShell.U... Imp...
Import-Csv Cmdlet Microsoft.PowerShell.U... Cre...
Measure-Object Cmdlet Microsoft.PowerShell.U... Cal...
Out-File Cmdlet Microsoft.PowerShell.U... Sen...
Out-GridView Cmdlet Microsoft.PowerShell.U... Sen...
Select-Object Cmdlet Microsoft.PowerShell.U... Sel...
Set-Variable Cmdlet Microsoft.PowerShell.U... Set...
Sort-Object Cmdlet Microsoft.PowerShell.U... Sor...
Tee-Object Cmdlet Microsoft.PowerShell.U... Sav...
Trace-Command Cmdlet Microsoft.PowerShell.U... Con...
Write-Information Cmdlet Microsoft.PowerShell.U... Spe...
Export-BinaryMiLog Cmdlet CimCmdlets Cre...
Get-CimAssociatedInstance Cmdlet CimCmdlets Ret...
Get-CimInstance Cmdlet CimCmdlets Get...
Import-BinaryMiLog Cmdlet CimCmdlets Use...
Invoke-CimMethod Cmdlet CimCmdlets Inv...
New-CimInstance Cmdlet CimCmdlets Cre...
Remove-CimInstance Cmdlet CimCmdlets Rem...
Set-CimInstance Cmdlet CimCmdlets Mod...
Compress-Archive Function Microsoft.PowerShell.A... Cre...
Get-Counter Cmdlet Microsoft.PowerShell.D... Get...
Invoke-WSManAction Cmdlet Microsoft.WSMan.Manage... Inv...
Remove-WSManInstance Cmdlet Microsoft.WSMan.Manage... Del...
Get-WSManInstance Cmdlet Microsoft.WSMan.Manage... Dis...
New-WSManInstance Cmdlet Microsoft.WSMan.Manage... Cre...
Set-WSManInstance Cmdlet Microsoft.WSMan.Manage... Mod...
about_Arithmetic_Operators HelpFile
about_Arrays HelpFile
about_Environment_Variables HelpFile
about_Execution_Policies HelpFile
about_Functions HelpFile
about_Jobs HelpFile
about_Logging HelpFile
about_Methods HelpFile
about_Objects HelpFile
about_Pipelines HelpFile
about_Preference_Variables HelpFile
about_Remote HelpFile
about_Remote_Jobs HelpFile
about_Session_Configuration_Files HelpFile
about_Simplified_Syntax HelpFile
about_Switch HelpFile
about_Variables HelpFile
about_Variable_Provider HelpFile
about_Windows_PowerShell_5.1 HelpFile
about_WQL HelpFile
about_WS-Management_Cmdlets HelpFile
about_Foreach-Parallel HelpFile
about_Parallel HelpFile
about_Sequence HelpFile
process검색하면 12개의 결과가 반환되었습니다. 그러나 processes검색할 때 78개의 결과가 생성되었습니다. 검색에서 일치하는 항목이 하나만 발견되면 Get-Help 검색 결과를 나열하는 대신 도움말 콘텐츠를 표시합니다.
help *hotfix*
NAME
Get-HotFix
SYNOPSIS
Gets the hotfixes that are installed on local or remote computers.
SYNTAX
Get-HotFix [-ComputerName <System.String[]>] [-Credential
<System.Management.Automation.PSCredential>] [-Description
<System.String[]>] [<CommonParameters>]
Get-HotFix [[-Id] <System.String[]>] [-ComputerName <System.String[]>]
[-Credential <System.Management.Automation.PSCredential>]
[<CommonParameters>]
DESCRIPTION
> This cmdlet is only available on the Windows platform. The
`Get-HotFix` cmdlet uses the Win32_QuickFixEngineering WMI class to
list hotfixes that are installed on the local computer or specified
remote computers.
RELATED LINKS
Online Version: https://learn.microsoft.com/powershell/module/microsoft.
powershell.management/get-hotfix?view=powershell-5.1&WT.mc_id=ps-gethelp
about_Arrays
Add-Content
Get-ComputerRestorePoint
Get-Credential
Win32_QuickFixEngineering class
REMARKS
To see the examples, type: "Get-Help Get-HotFix -Examples".
For more information, type: "Get-Help Get-HotFix -Detailed".
For technical information, type: "Get-Help Get-HotFix -Full".
For online help, type: "Get-Help Get-HotFix -Online"
Get-Help를 사용하면 도움말 문서가 없는 명령어를 찾을 수 있는데, 이 기능은 일반적으로 잘 알려져 있지 않습니다.
more 함수는 도움말 문서가 없는 명령 중 하나입니다. 도움말 문서를 포함하지 않는 Get-Help 명령을 찾을 수 있는지 확인하려면 help 함수를 사용하여 more찾습니다.
help *more*
검색에서 일치하는 항목이 하나만 발견되었으므로 명령에 도움말 문서가 없을 때 표시되는 기본 구문 정보를 반환했습니다.
NAME
more
SYNTAX
more [[-paths] <string[]>]
ALIASES
None
REMARKS
None
PowerShell 도움말 시스템에는 이론적 설명 정보 도움말 문서도 포함되어 있습니다. 정보 문서를 얻으려면 시스템의 도움말 콘텐츠를 업데이트해야 합니다. 자세한 내용은 이 챕터의 업데이트 도움말 섹션을 참조하세요.
다음 명령을 사용하여 시스템의 모든 정보 도움말 문서의 목록을 반환합니다.
help About_*
결과를 정보 도움말 문서로 제한하면 Get-Help 해당 문서의 내용을 표시합니다.
help about_Updatable_Help
도움말 업데이트
이 장 앞부분에서는 Get-Help cmdlet을 처음 실행할 때 컴퓨터의 PowerShell 도움말 문서를 업데이트했습니다. 도움말 콘텐츠에 대한 업데이트를 받으려면 컴퓨터에서 Update-Help cmdlet을 주기적으로 실행해야 합니다.
중요합니다
Windows PowerShell 5.1에서는 권한이 상승된 관리자 PowerShell 세션에서 Update-Help을 실행해야 합니다.
다음 예제에서 Update-Help 컴퓨터에 설치된 모든 모듈에 대한 PowerShell 도움말 콘텐츠를 다운로드합니다.
Force 매개 변수를 사용하여 최신 버전의 도움말 콘텐츠를 다운로드해야 합니다.
Update-Help -Force
다음 결과와 같이 모듈에서 오류를 반환했습니다. 오류는 일반적이지 않으며 일반적으로 모듈 작성자가 수정 가능한 도움말을 올바르게 구성하지 않는 경우에 발생합니다.
Update-Help : Failed to update Help for the module(s) 'BitsTransfer' with UI
culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for UI culture
en-US. Make sure the HelpInfoUri property in the module manifest is valid or
check your network connection and then try the command again.
At line:1 char:1
+ Update-Help
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Update-Help], Except
ion
+ FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShe
ll.Commands.UpdateHelpCommand
Update-Help 도움말 콘텐츠를 다운로드하려면 인터넷에 액세스해야 합니다. 컴퓨터에 인터넷에 액세스할 수 없는 경우 인터넷에 액세스할 수 있는 컴퓨터의 Save-Help cmdlet을 사용하여 업데이트된 도움말 콘텐츠를 다운로드하고 저장합니다. 그런 다음 Update-Help 매개 변수를 사용하여 저장된 업데이트된 도움말 콘텐츠의 위치를 지정합니다.
Get-Command (명령어 검색)
Get-Command 명령을 찾는 데 도움이 되는 또 다른 다목적 명령입니다. 매개 변수 없이 Get-Command 실행하면 시스템의 모든 PowerShell 명령 목록이 반환됩니다.
Get-Command 사용하여 Get-Help유사한 명령 구문을 가져올 수도 있습니다.
Get-Command구문을 확인하려면 어떻게 해야 할까요? 이 챕터의 Get-Help 섹션에 표시된 것처럼 Get-Command 사용하여 대한 도움말 문서를 표시할 수 있습니다.
Get-Command 매개 변수와 함께 사용하여 명령에 대한 구문을 볼 수도 있습니다. 이 바로 가기를 사용하면 도움말 콘텐츠를 탐색하지 않고 명령을 사용하는 방법을 빠르게 결정할 수 있습니다.
Get-Command -Name Get-Command -Syntax
Get-Command 매개 변수와 함께 사용하면 Get-Help 쇼와 같은 허용 가능한 특정 값을 나열하지 않고도 매개 변수 및 해당 값 형식을 보여 주는 구문을 보다 간결하게 볼 수 있습니다.
Get-Command [[-ArgumentList] <Object[]>] [-Verb <string[]>]
[-Noun <string[]>] [-Module <string[]>]
[-FullyQualifiedModule <ModuleSpecification[]>] [-TotalCount <int>]
[-Syntax] [-ShowCommandInfo] [-All] [-ListImported]
[-ParameterName <string[]>] [-ParameterType <PSTypeName[]>]
[<CommonParameters>]
Get-Command [[-Name] <string[]>] [[-ArgumentList] <Object[]>]
[-Module <string[]>] [-FullyQualifiedModule <ModuleSpecification[]>]
[-CommandType <CommandTypes>] [-TotalCount <int>] [-Syntax]
[-ShowCommandInfo] [-All] [-ListImported] [-ParameterName <string[]>]
[-ParameterType <PSTypeName[]>] [<CommonParameters>]
명령을 사용하는 방법에 대한 자세한 정보가 필요한 경우 Get-Help사용합니다.
help Get-Command -Full
Get-Help 섹션에서는 매개 변수에 대한 열거형 값을 확장하여 보다 사용자에게 친숙한 표시를 제공합니다. 사용할 수 있는 실제 값을 보여 주므로 사용 가능한 옵션을 더 쉽게 이해할 수 있습니다.
...
Get-Command [[-Name] <System.String[]>] [[-ArgumentList]
<System.Object[]>] [-All] [-CommandType {Alias | Function | Filter |
Cmdlet | ExternalScript | Application | Script | Workflow |
Configuration | All}] [-FullyQualifiedModule
<Microsoft.PowerShell.Commands.ModuleSpecification[]>] [-ListImported]
[-Module <System.String[]>] [-ParameterName <System.String[]>]
[-ParameterType <System.Management.Automation.PSTypeName[]>]
[-ShowCommandInfo] [-Syntax] [-TotalCount <System.Int32>]
[<CommonParameters>]
Get-Command [[-ArgumentList] <System.Object[]>] [-All]
[-FullyQualifiedModule
<Microsoft.PowerShell.Commands.ModuleSpecification[]>] [-ListImported]
[-Module <System.String[]>] [-Noun <System.String[]>] [-ParameterName
<System.String[]>] [-ParameterType
<System.Management.Automation.PSTypeName[]>] [-ShowCommandInfo]
[-Syntax] [-TotalCount <System.Int32>] [-Verb <System.String[]>]
[<CommonParameters>]
...
도움말의 Get-Command 섹션에서는 이름, 명사및 동사 매개 변수가 와일드카드 문자를 허용한다는 것을 알 수 있습니다.
...
-Name <System.String[]>
Specifies an array of names. This cmdlet gets only commands that
have the specified name. Enter a name or name pattern. Wildcard
characters are permitted.
To get commands that have the same name, use the All parameter. When
two commands have the same name, by default, `Get-Command` gets the
command that runs when you type the command name.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? true
-Noun <System.String[]>
Specifies an array of command nouns. This cmdlet gets commands,
which include cmdlets, functions, and aliases, that have names that
include the specified noun. Enter one or more nouns or noun
patterns. Wildcard characters are permitted.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? true
-Verb <System.String[]>
Specifies an array of command verbs. This cmdlet gets commands,
which include cmdlets, functions, and aliases, that have names that
include the specified verb. Enter one or more verbs or verb
patterns. Wildcard characters are permitted.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? true
...
다음 예제에서는 * 와일드카드 문자를 의 Get-Command 매개 변수 값과 함께 사용합니다.
Get-Command -Name *service*
Get-Command 매개 변수와 함께 와일드카드 문자를 사용하면 다음 결과와 같이 PowerShell 명령 및 네이티브 명령이 반환됩니다.
CommandType Name Version
----------- ---- -------
Function Get-NetFirewallServiceFilter 2.0.0.0
Function Set-NetFirewallServiceFilter 2.0.0.0
Cmdlet Get-Service 3.1.0.0
Cmdlet New-Service 3.1.0.0
Cmdlet New-WebServiceProxy 3.1.0.0
Cmdlet Restart-Service 3.1.0.0
Cmdlet Resume-Service 3.1.0.0
Cmdlet Set-Service 3.1.0.0
Cmdlet Start-Service 3.1.0.0
Cmdlet Stop-Service 3.1.0.0
Cmdlet Suspend-Service 3.1.0.0
Application SecurityHealthService.exe 10.0.2...
Application SensorDataService.exe 10.0.2...
Application services.exe 10.0.2...
Application services.msc 0.0.0.0
Application TieringEngineService.exe 10.0.2...
Application Windows.WARP.JITService.exe 10.0.2...
Get-Command 매개 변수를 사용하여 결과를 PowerShell 명령으로 제한할 수 있습니다.
Get-Command -Name *service* -CommandType Cmdlet, Function, Alias, Script
또 다른 옵션은 powerShell 명령에만 동사와 명사가 있기 때문에 동사 또는 명사 매개 변수를 사용하는 것입니다.
다음 예제에서는 Get-Command 사용하여 컴퓨터에서 프로세스와 함께 작동하는 명령을 찾습니다.
Noun 매개 변수를 사용하고 Process 해당 값으로 지정합니다.
Get-Command -Noun Process
CommandType Name Version
----------- ---- -------
Cmdlet Debug-Process 3.1.0.0
Cmdlet Get-Process 3.1.0.0
Cmdlet Start-Process 3.1.0.0
Cmdlet Stop-Process 3.1.0.0
Cmdlet Wait-Process 3.1.0.0
요약
이 챕터에서는 Get-HelpGet-Command명령을 찾는 방법을 알아보았습니다. 또한 도움말 시스템을 사용하여 명령을 찾은 후 사용하는 방법을 이해하는 방법도 알아보았습니다. 또한 새 도움말 콘텐츠를 사용할 수 있는 경우 컴퓨터에서 도움말 시스템을 업데이트하는 방법을 알아보았습니다.
검토
-
DisplayName 매개 변수가
Get-Service에서 위치에 따라 결정되나요? -
Get-Processcmdlet에는 몇 개의 매개 변수 집합이 있나요? - 이벤트 로그 작업을 위한 PowerShell 명령은 무엇인가요?
- 컴퓨터에서 실행되는 PowerShell 프로세스 목록을 반환하기 위한 PowerShell 명령은 무엇인가요?
- 컴퓨터에 저장된 PowerShell 도움말 콘텐츠를 업데이트하려면 어떻게 해야 할까요?
참고문헌
이 챕터에서 다루는 개념에 대해 자세히 알아보려면 다음 PowerShell 도움말 문서를 참조하세요.
다음 단계
다음 챕터에서는 개체, 속성, 메서드 및 Get-Member cmdlet에 대해 알아봅니다.
PowerShell