Get-PSBreakpoint
현재 세션에 설정되어 있는 중단점을 가져옵니다.
구문
Get-PSBreakpoint [[-Script] <string[]>] [<CommonParameters>]
Get-PSBreakpoint -Command <string[]> [-Script <string[]>] [<CommonParameters>]
Get-PSBreakpoint [-Id] <Int32[]> [<CommonParameters>]
Get-PSBreakpoint [-Type] <BreakpointType[]> [-Script <string[]>] [<CommonParameters>]
Get-PSBreakpoint -Variable <string[]> [-Script <string[]>] [<CommonParameters>]
설명
Get-PSBreakPoint cmdlet은 현재 세션에 설정되어 있는 중단점을 가져옵니다. cmdlet 매개 변수를 사용하여 특정 중단점을 가져올 수 있습니다.
중단점은 명령이나 스크립트에서 지침을 확인할 수 있도록 일시적으로 실행이 중지되는 지점입니다. Get-PSBreakpoint는 Windows PowerShell 스크립트 및 명령 디버깅에 사용되는 여러 cmdlet 중 하나입니다. Windows PowerShell 디버거에 대한 자세한 내용은 about_Debuggers를 참조하십시오.
매개 변수
-Command <string[]>
지정된 명령 이름에 설정되어 있는 명령 중단점을 가져옵니다. cmdlet 또는 함수 이름과 같은 명령 이름을 입력하십시오.
필수 여부 |
true |
위치 |
named |
기본값 |
모든 중단점 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 적용 여부 |
false |
-Id <Int32[]>
지정된 중단점 ID를 가진 중단점을 가져옵니다. 쉼표로 구분된 목록에 ID를 입력합니다. 중단점 ID를 Get-PSBreakpoint로 파이프할 수도 있습니다.
필수 여부 |
true |
위치 |
1 |
기본값 |
모든 중단점 |
파이프라인 입력 적용 여부 |
true (ByValue) |
와일드카드 문자 적용 여부 |
false |
-Script <string[]>
지정된 스크립트에서 중단점만 가져옵니다. 하나 이상의 스크립트 파일의 경로(선택 사항) 및 이름을 입력합니다. 기본 위치는 현재 디렉터리입니다.
필수 여부 |
false |
위치 |
named |
기본값 |
모든 중단점 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 적용 여부 |
false |
-Type <BreakpointType[]>
지정된 유형의 중단점만 가져옵니다. 하나 이상의 유형을 입력합니다. 유효한 값은 Line, Command 및 Variable입니다. 중단점 유형을 Get-PSBreakpoint로 파이프할 수도 있습니다.
필수 여부 |
true |
위치 |
1 |
기본값 |
모든 중단점 |
파이프라인 입력 적용 여부 |
true (ByValue) |
와일드카드 문자 적용 여부 |
false |
-Variable <string[]>
지정된 변수 이름에 설정되어 있는 변수 중단점을 가져옵니다. 달러 기호 없이 변수 이름을 입력하십시오.
필수 여부 |
true |
위치 |
named |
기본값 |
모든 중단점 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 적용 여부 |
false |
<CommonParameters>
이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 about_commonparameters.
입력 및 출력
입력 유형은 cmdlet으로 파이프할 수 있는 개체의 유형입니다. 반환 유형은 cmdlet에서 반환되는 개체의 유형입니다.
입력 |
System.Int32, Microsoft.PowerShell.Commands.BreakpointType 중단점 ID 및 중단점 유형을 Get-PSBreakpoint로 파이프할 수도 있습니다. |
출력 |
중단점 개체(System.Management.Automation.LineBreakpoint, System.Management.Automation.VariableBreakpoint, System.Management.Automation.CommandBreakpoint) Get-PSBreakPoint는 세션의 중단점을 나타내는 개체를 반환합니다. |
참고
Get-PSBreakpoint 또는 해당 별칭("gbp")을 사용할 수 있습니다.
예 1
C:\PS>get-psbreakpoint
설명
-----------
이 명령은 현재 세션의 모든 스크립트 및 함수에서 모든 중단점 집합을 가져옵니다.
예 2
C:\PS>get-psbreakpoint -Id 2
Function : Increment
Action :
Enabled : True
HitCount : 0
Id : 2
Script : C:\ps-test\sample.ps1
ScriptName : C:\ps-test\sample.ps1
설명
-----------
이 명령은 중단점 ID가 2인 중단점을 가져옵니다.
예 3
C:\PS>$b = set-psbreakpoint -script sample.ps1 -function increment
C:\PS> $b.Id | get-psbreakpoint
설명
-----------
이들 명령은 중단점 ID를 Get-PSBreakpoint로 파이프하여 중단점을 가져오는 방법을 보여 줍니다.
첫 번째 명령은 Set-PSBreakpoint cmdlet을 사용하여 Sample.ps1 스크립트의 Increment 함수에 중단점을 만들고 중단점 개체를 $b 변수에 저장합니다.
두 번째 명령은 점 연산자(.)를 사용하여 $b 변수에 있는 중단점 개체의 ID 속성을 가져옵니다. 파이프라인 연산자(|)를 사용하여 ID를 Get-PSBreakpoint cmdlet으로 보냅니다.
따라서 Get-PSBreakpoint는 지정된 ID를 가진 중단점을 가져옵니다.
예 4
C:\PS>get-psbreakpoint -script Sample.ps1, SupportScript.ps1
설명
-----------
이 명령은 Sample.ps1 및 SupportScript.ps1 파일의 모든 중단점을 가져옵니다.
이 명령은 세션의 다른 스크립트나 함수에 설정되어 있을 수 있는 기타 중단점은 가져오지 않습니다.
예 5
C:\PS>get-psbreakpoint -command Read-Host, Write-Host -script Sample.ps1
설명
-----------
이 명령은 Sample.ps1 파일의 Read-Host 또는 Write-Host 명령에 설정되어 있는 모든 명령 중단점을 가져옵니다.
예 6
C:\PS>get-psbreakpoint -type Command -script Sample.ps1
설명
-----------
이 명령은 Sample.ps1 파일의 모든 명령 중단점을 가져옵니다.
예 7
C:\PS>get-psbreakpoint -variable Index, Swap
설명
-----------
이 명령은 현재 세션의 $index 및 $swap 변수에 설정되어 있는 중단점을 가져옵니다.
예 8
C:\PS>get-psbreakpoint -type line, variable -script Sample.ps1
설명
-----------
이 명령은 Sample.ps1 스크립트의 모든 줄 중단점 및 변수 중단점을 가져옵니다.
참고 항목
개념
about_Debuggers
Set-PSBreakpoint
Disable-PSBreakpoint
Enable-PSBreakpoint
Remove-PSBreakpoint
Get-PSCallStack