Get-Job
현재 세션에서 실행 중인 PowerShell 백그라운드 작업을 가져옵니다.
구문
SessionIdParameterSet (기본값)
Get-Job
[[-Id] <Int32[]>]
[-IncludeChildJob]
[-ChildJobState <JobState>]
[-HasMoreData <Boolean>]
[-Before <DateTime>]
[-After <DateTime>]
[-Newest <Int32>]
[<CommonParameters>]
StateParameterSet
Get-Job
[-State] <JobState>
[-IncludeChildJob]
[-ChildJobState <JobState>]
[-HasMoreData <Boolean>]
[-Before <DateTime>]
[-After <DateTime>]
[-Newest <Int32>]
[<CommonParameters>]
CommandParameterSet
Get-Job
[-IncludeChildJob]
[-ChildJobState <JobState>]
[-HasMoreData <Boolean>]
[-Before <DateTime>]
[-After <DateTime>]
[-Newest <Int32>]
[-Command <String[]>]
[<CommonParameters>]
InstanceIdParameterSet
Get-Job
[-InstanceId] <Guid[]>
[-IncludeChildJob]
[-ChildJobState <JobState>]
[-HasMoreData <Boolean>]
[-Before <DateTime>]
[-After <DateTime>]
[-Newest <Int32>]
[<CommonParameters>]
NameParameterSet
Get-Job
[-Name] <String[]>
[-IncludeChildJob]
[-ChildJobState <JobState>]
[-HasMoreData <Boolean>]
[-Before <DateTime>]
[-After <DateTime>]
[-Newest <Int32>]
[<CommonParameters>]
FilterParameterSet
Get-Job
[-Filter] <Hashtable>
[<CommonParameters>]
Description
Get-Job cmdlet은 현재 세션에서 시작된 백그라운드 작업을 나타내는 개체를 가져옵니다.
get-Job
매개 변수가 없으면 Get-Job 명령은 현재 세션의 모든 작업을 가져옵니다.
get-Job
Get-Job 반환하는
Windows PowerShell 백그라운드 작업은 현재 세션과 상호 작용하지 않고 백그라운드에서 실행되는 명령입니다. 일반적으로 백그라운드 작업을 사용하여 완료하는 데 시간이 오래 걸리는 복잡한 명령을 실행합니다. Windows PowerShell의 백그라운드 작업에 대한 자세한 내용은 about_Jobs 참조하세요.
Windows PowerShell 3.0부터 Get-Job cmdlet은 워크플로 작업 및 예약된 작업의 인스턴스와 같은 사용자 지정 작업 유형도 가져옵니다. 작업의 작업 유형을 찾으려면 작업의 PSJobTypeName 속성을 사용합니다.
Get-Job 사용자 지정 작업 유형을 가져오려면 Import-Module cmdlet을 사용하거나 모듈에서 cmdlet을 사용하거나 가져와서 Get-Job 명령을 실행하기 전에 사용자 지정 작업 유형을 지원하는 모듈을 세션으로 가져옵니다. 특정 사용자 지정 작업 유형에 대한 자세한 내용은 사용자 지정 작업 유형 기능의 설명서를 참조하세요.
예제
예제 1: 현재 세션에서 모든 백그라운드 작업 시작
PS C:\> Get-Job
이 명령은 현재 세션에서 시작된 모든 백그라운드 작업을 가져옵니다. 로컬 컴퓨터에서 작업이 실행되더라도 다른 세션에서 만든 작업은 포함되지 않습니다.
예제 2: 인스턴스 ID를 사용하여 작업 중지
The first command uses the **Get-Job** cmdlet to get a job. It uses the *Name* parameter to identify the job. The command stores the job object that **Get-Job** returns in the $j variable. In this example, there is only one job with the specified name.
PS C:\> $j = Get-Job -Name Job1
The second command gets the **InstanceId** property of the object in the $j variable and stores it in the $ID variable.
PS C:\> $ID = $j.InstanceID
The third command displays the value of the $ID variable.
PS C:\> $ID
Guid
----
03c3232e-1d23-453b-a6f4-ed73c9e29d55
The fourth command uses Stop-Job cmdlet to stop the job. It uses the *InstanceId* parameter to identify the job and $ID variable to represent the instance ID of the job.
PS C:\> Stop-Job -InstanceId $ID
이러한 명령은 작업의 인스턴스 ID를 가져오고 이를 사용하여 작업을 중지하는 방법을 보여 줍니다. 고유하지 않은 작업의 이름과 달리 인스턴스 ID는 고유합니다.
예제 3: 특정 명령을 포함하는 작업 가져오기
PS C:\> Get-Job -Command "*get-process*"
이 명령은 Get-Process 명령을 포함하는 시스템의 작업을 가져옵니다. 이 명령은 Get-JobCommand 매개 변수를 사용하여 검색된 작업을 제한합니다. 이 명령은 와일드카드 문자(*)를 사용하여 명령 문자열의 아무 곳이나 Get-Process 명령을 포함하는 작업을 가져옵니다.
예제 4: 파이프라인을 사용하여 특정 명령을 포함하는 작업 가져오기
PS C:\> "*get-process*" | Get-Job
이전 예제의 명령과 마찬가지로 이 명령은 Get-Process 명령을 포함하는 시스템의 작업을 가져옵니다. 이 명령은 파이프라인 연산자(|)를 사용하여 문자열을 따옴표로 Get-Job cmdlet으로 보냅니다. 이전 명령과 동일합니다.
예제 5: 시작되지 않은 작업 가져오기
PS C:\> Get-Job -State NotStarted
이 명령은 생성되었지만 아직 시작되지 않은 작업만 가져옵니다. 여기에는 나중에 실행되도록 예약된 작업과 아직 예약되지 않은 작업이 포함됩니다.
예제 6: 이름이 할당되지 않은 작업 가져오기
PS C:\> Get-Job -Name Job*
이 명령은 작업으로 시작하는 작업 이름이 있는 모든 작업을 가져옵니다. 작업<번호> 작업의 기본 이름이기 때문에 이 명령은 명시적으로 할당된 이름이 없는 모든 작업을 가져옵니다.
예제 7: 작업 개체를 사용하여 명령의 작업 표시
The first command uses the **Start-Job** cmdlet to start a background job that runs a **Get-Process** command on the local computer. The command uses the *Name* parameter of **Start-Job** to assign a friendly name to the job.
PS C:\> Start-Job -ScriptBlock {Get-Process} -Name MyJob
The second command uses Get-Job to get the job. It uses the *Name* parameter of **Get-Job** to identify the job. The command saves the resulting job object in the $j variable.
PS C:\> $j = Get-Job -Name MyJob
The third command displays the value of the job object in the $j variable. The value of the **State** property shows that the job is completed. The value of the **HasMoreData** property shows that there are results available from the job that have not yet been retrieved.
PS C:\> $j
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
6 MyJob BackgroundJob Completed True localhost Get-Process
The fourth command uses the **Receive-Job** cmdlet to get the results of the job. It uses the job object in the $j variable to represent the job. You can also use a pipeline operator to send a job object to **Receive-Job**.
PS C:\> Receive-Job -Job $j
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
124 4 13572 12080 59 1140 audiodg
783 16 11428 13636 100 548 CcmExec
96 4 4252 3764 59 3856 ccmsetup
...
이 예제에서는 Get-Job 사용하여 작업 개체를 가져오는 방법을 보여 낸 다음 작업 개체를 사용하여 명령에서 작업을 나타내는 방법을 보여 있습니다.
예제 8: 다른 방법으로 시작된 작업을 포함한 모든 작업 가져오기
The first command uses the **Start-Job** cmdlet to start a job on the local computer.
PS C:\> Start-Job -ScriptBlock {Get-EventLog System}
The second command uses the *AsJob* parameter of the **Invoke-Command** cmdlet to start a job on the S1 computer. Even though the commands in the job run on the remote computer, the job object is created on the local computer, so you use local commands to manage the job.
PS C:\> Invoke-Command -ComputerName S1 -ScriptBlock {Get-EventLog System} -AsJob
The third command uses the **Invoke-Command** cmdlet to run a **Start-Job** command on the S2 computer. By using this method, the job object is created on the remote computer, so you use remote commands to manage the job.
PS C:\> Invoke-Command -ComputerName S2 -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog System}}
The fourth command uses **Get-Job** to get the jobs stored on the local computer. The **PSJobTypeName** property of jobs, introduced in Windows PowerShell 3.0, shows that the local job started by using the **Start-Job** cmdlet is a background job and the job started in a remote session by using the **Invoke-Command** cmdlet is a remote job.
PS C:\> Get-Job
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Running True localhost Get-EventLog System
2 Job2 RemoteJob Running True S1 Get-EventLog System
The fifth command uses **Invoke-Command** to run a **Get-Job** command on the S2 computer.The sample output shows the results of the Get-Job command. On the S2 computer, the job appears to be a local job. The computer name is localhost and the job type is a background job.For more information about how to run background jobs on remote computers, see about_Remote_Jobs.
PS C:\> Invoke-Command -ComputerName S2 -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog System}}
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- ------- -------
4 Job4 BackgroundJob Running True localhost Get-Eventlog System
이 예제에서는 Get-Job cmdlet이 다른 메서드를 사용하여 시작한 경우에도 현재 세션에서 시작된 모든 작업을 가져올 수 있음을 보여 줍니다.
예제 9: 실패한 작업 조사
The first command uses the **Start-Job** cmdlet to start a job on the local computer. The job object that **Start-Job** returns shows that the job failed. The value of the **State** property is Failed.
PS C:\> Start-Job -ScriptBlock {Get-Process}
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Failed False localhost Get-Process
The second command uses the **Get-Job** cmdlet to get the job. The command uses the dot method to get the value of the **JobStateInfo** property of the object. It uses a pipeline operator to send the object in the **JobStateInfo** property to the Format-List cmdlet, which formats all of the properties of the object (*) in a list.The result of the **Format-List** command shows that the value of the **Reason** property of the job is blank.
PS C:\> (Get-Job).JobStateInfo | Format-List -Property *
State : Failed
Reason :
The third command investigates more. It uses a **Get-Job** command to get the job and then uses a pipeline operator to send the whole job object to the **Format-List** cmdlet, which displays all of the properties of the job in a list.The display of all properties in the job object shows that the job contains a child job named Job2.
PS C:\> Get-Job | Format-List -Property *
HasMoreData : False
StatusMessage :
Location : localhost
Command : get-process
JobStateInfo : Failed
Finished : System.Threading.ManualReset
EventInstanceId : fb792295-1318-4f5d-8ac8-8a89c5261507
Id : 1
Name : Job1
ChildJobs : {Job2}
Output : {}
Error : {}
Progress : {}
Verbose : {}
Debug : {}
Warning : {}
StateChanged :
The fourth command uses **Get-Job** to get the job object that represents the Job2 child job. This is the job in which the command actually ran. It uses the dot method to get the **Reason** property of the **JobStateInfo** property.The result shows that the job failed because of an Access Denied error. In this case, the user forgot to use the Run as administrator option when starting Windows PowerShell.Because background jobs use the remoting features of Windows PowerShell, the computer must be configured for remoting to run a job, even when the job runs on the local computer.For information about requirements for remoting in Windows PowerShell, see about_Remote_Requirements. For troubleshooting tips, see about_Remote_Troubleshooting.
PS C:\> (Get-Job -Name job2).JobStateInfo.Reason
Connecting to remote server using WSManCreateShellEx api failed. The async callback gave the following error message: Access is denied.
이 명령은 Get-Job 반환할
예제 10: 필터링된 결과 가져오기
The first command uses the **Workflow** keyword to create the WFProcess workflow.
PS C:\> Workflow WFProcess {Get-Process}
The second command uses the *AsJob* parameter of the WFProcess workflow to run the workflow as a background job. It uses the *JobName* parameter of the workflow to specify a name for the job, and the *PSPrivateMetadata* parameter of the workflow to specify a custom ID.
PS C:\> WFProcess -AsJob -JobName WFProcessJob -PSPrivateMetadata @{MyCustomId = 92107}
The third command uses the *Filter* parameter of **Get-Job** to get the job by custom ID that was specified in the *PSPrivateMetadata* parameter.
PS C:\> Get-Job -Filter @{MyCustomId = 92107}
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
1 WFProcessJob Completed True localhost WFProcess
이 예제에서는 Filter 매개 변수를 사용하여 워크플로 작업을 가져오는 방법을 보여줍니다. Windows PowerShell 3.0에 도입된 Filter 매개 변수는 워크플로 작업 및 예약된 작업과 같은 사용자 지정 작업 유형에서만 유효합니다.
예제 11: 자식 작업에 대한 정보 가져오기
The first command gets the jobs in the current session. The output includes a background job, a remote job and several instances of a scheduled job. The remote job, Job4, appears to have failed.
PS C:\> Get-Job
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1
4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1
7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
The second command uses the *IncludeChildJob* parameter of **Get-Job**. The output adds the child jobs of all jobs that have child jobs.In this case, the revised output shows that only the Job5 child job of Job4 failed.
PS C:\> Get-Job -IncludeChildJob
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1
3 Job3 Completed True localhost .\Get-Archive.ps1
4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1
5 Job5 Failed False Server01 .\Get-Archive.ps1
6 Job6 Completed True Server02 .\Get-Archive.ps1
7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
The third command uses the *ChildJobState* parameter with a value of Failed.The output includes all parent jobs and only the child jobs that failed.
PS C:\> Get-Job -Name Job4 -ChildJobState Failed
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1
4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1
5 Job5 Failed False Server01 .\Get-Archive.ps1
7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help
The fifth command uses the **JobStateInfo** property of jobs and its **Reason** property to discover why Job5 failed.
PS C:\> (Get-Job -Name Job5).JobStateInfo.Reason
Connecting to remote server Server01 failed with the following error message:
Access is denied.
For more information, see the about_Remote_Troubleshooting Help topic.
이 예제에서는 Get-Job cmdlet의 IncludeChildJob 및 ChildJobState 매개 변수를 사용하는 효과를 보여줍니다.
매개 변수
-After
지정된 날짜 및 시간 이후에 종료된 완료된 작업을 가져옵니다.
Get-Date cmdlet에서 반환된 개체 또는 또는 같은 Dec 1, 2012 2:00 AM 개체로 변환할 수 있는 문자열과 같은 11/06 개체를 입력합니다.
이 매개 변수는 EndTime 속성이 있는 워크플로 작업 및 예약된 작업과 같은 사용자 지정 작업 유형에서만 작동합니다. Start-Job cmdlet을 사용하여 만든 작업과 같은 표준 백그라운드 작업에서는 작동하지 않습니다. 이 매개 변수에 대한 지원에 대한 자세한 내용은 작업 유형에 대한 도움말 항목을 참조하세요.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | DateTime |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-Before
지정된 날짜 및 시간 이전에 종료된 완료된 작업을 가져옵니다. DateTime 개체를 입력합니다.
이 매개 변수는 EndTime 속성이 있는 워크플로 작업 및 예약된 작업과 같은 사용자 지정 작업 유형에서만 작동합니다. Start-Job cmdlet을 사용하여 만든 작업과 같은 표준 백그라운드 작업에서는 작동하지 않습니다. 이 매개 변수에 대한 지원에 대한 자세한 내용은 작업 유형에 대한 도움말 항목을 참조하세요.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | DateTime |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-ChildJobState
지정된 상태가 있는 자식 작업만 가져옵니다. 이 매개 변수에 허용되는 값은 다음과 같습니다.
- 시작되지 않음
- 실행 중
- 완료됨
- 실패
- 중지됨
- 차단됨
- 일시 중단됨
- 단절됨
- 일시 중지
- 중지 중
기본적으로 get-Job
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | JobState |
| Default value: | None |
| 허용되는 값: | NotStarted, Running, Completed, Failed, Stopped, Blocked, Suspended, Disconnected, Suspending, Stopping, AtBreakpoint |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-Command
명령 배열을 문자열로 지정합니다. 이 cmdlet은 지정된 명령을 포함하는 작업을 가져옵니다. 기본값은 모든 작업입니다. 와일드카드 문자를 사용하여 명령 패턴을 지정할 수 있습니다.
매개 변수 속성
| 형식: | String[] |
| Default value: | None |
| 와일드카드 지원: | True |
| DontShow: | False |
매개 변수 집합
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-Filter
조건의 해시 테이블을 지정합니다. 이 cmdlet은 모든 조건을 충족하는 작업을 가져옵니다. 키가 작업 속성이고 값이 작업 속성 값인 해시 테이블을 입력합니다.
이 매개 변수는 워크플로 작업 및 예약된 작업과 같은 사용자 지정 작업 유형에서만 작동합니다. Start-Job cmdlet을 사용하여 만든 작업과 같은 표준 백그라운드 작업에서는 작동하지 않습니다. 이 매개 변수에 대한 지원에 대한 자세한 내용은 작업 유형에 대한 도움말 항목을 참조하세요.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | Hashtable |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
FilterParameterSet
| Position: | 0 |
| 필수: | True |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-HasMoreData
이 cmdlet이 지정된 HasMoreData 속성 값이 있는 작업만 가져오는지 여부를 나타냅니다. HasMoreData 속성은 현재 세션에서 모든 작업 결과를 받았는지 여부를 나타냅니다. 더 많은 결과가 있는 작업을 얻으려면 $True 값을 지정합니다. 더 많은 결과가 없는 작업을 얻으려면 $False 값을 지정합니다.
작업의 결과를 얻으려면 Receive-Job cmdlet을 사용합니다.
Receive-Job cmdlet을 사용하면 메모리 내 세션별 스토리지에서 반환된 결과를 삭제합니다.
현재 세션에서 작업의 모든 결과를 반환한 경우 작업의 HasMoreData 속성 값을 $False)로 설정하여 현재 세션에서 작업에 대한 결과가 더 이상 없음을 나타냅니다.
Receive-JobKeep 매개 변수를 사용하여 Receive-Job 결과를 삭제하고 HasMoreData 속성의 값을 변경하지 못하도록 합니다.
자세한 내용은 Get-Help Receive-Job입력합니다.
HasMoreData 속성은 현재 세션과 관련이 있습니다. 사용자 지정 작업 유형에 대한 결과가 디스크에 작업 결과를 저장하는 예약된 작업 유형과 같은 세션 외부에 저장되는 경우 HasMoreData 값이 $False 경우에도 다른 세션의 Receive-Job cmdlet을 사용하여 작업 결과를 다시 가져올 수 있습니다. 자세한 내용은 사용자 지정 작업 유형에 대한 도움말 항목을 참조하세요.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | Boolean |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-Id
이 cmdlet이 가져오는 작업의 ID 배열을 지정합니다.
ID는 현재 세션의 작업을 고유하게 식별하는 정수입니다.
인스턴스 ID보다 기억하고 입력하는 것이 더 쉽지만 현재 세션에서만 고유합니다.
하나 이상의 ID를 쉼표로 구분하여 입력할 수 있습니다.
작업의 ID를 찾으려면 매개 변수 없이 Get-Job 입력합니다.
매개 변수 속성
| 형식: | Int32[] |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | 0 |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-IncludeChildJob
이 cmdlet은 부모 작업 외에도 자식 작업을 반환한다는 것을 나타냅니다.
이 매개 변수는 실패의 이유가 자식 작업의 속성에 저장되므로 Get-Job 컨테이너 부모 작업 및 작업 실패를 반환하는 워크플로 작업을 조사하는 데 특히 유용합니다.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | SwitchParameter |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-InstanceId
이 cmdlet이 가져오는 작업의 인스턴스 ID 배열을 지정합니다. 기본값은 모든 작업입니다.
인스턴스 ID는 컴퓨터에서 작업을 고유하게 식별하는 GUID입니다. 작업의 인스턴스 ID를 찾으려면 Get-Job사용합니다.
매개 변수 속성
| 형식: | Guid[] |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
InstanceIdParameterSet
| Position: | 0 |
| 필수: | True |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-Name
이 cmdlet이 가져오는 작업의 인스턴스 이름 배열을 지정합니다. 작업 이름을 입력하거나 와일드카드 문자를 사용하여 작업 이름 패턴을 입력합니다. 기본적으로 Get-Job 현재 세션의 모든 작업을 가져옵니다.
매개 변수 속성
| 형식: | String[] |
| Default value: | None |
| 와일드카드 지원: | True |
| DontShow: | False |
매개 변수 집합
NameParameterSet
| Position: | 0 |
| 필수: | True |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-Newest
가져올 작업 수를 지정합니다. 이 cmdlet은 가장 최근에 종료된 작업을 가져옵니다.
Newest 매개 변수는 최신 작업을 최종 시간 순서로 정렬하거나 반환하지 않습니다. 출력을 정렬하려면 Sort-Object cmdlet을 사용합니다.
이 매개 변수는 Windows PowerShell 3.0에서 도입되었습니다.
매개 변수 속성
| 형식: | Int32 |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
SessionIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
StateParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommandParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
InstanceIdParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
NameParameterSet
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-State
작업 상태를 지정합니다. 이 cmdlet은 지정된 상태의 작업만 가져옵니다. 이 매개 변수에 허용되는 값은 다음과 같습니다.
- 시작되지 않음
- 실행 중
- 완료됨
- 실패
- 중지됨
- 차단됨
- 일시 중단됨
- 단절됨
- 일시 중지
- 중지 중
기본적으로 Get-Job 현재 세션의 모든 작업을 가져옵니다.
작업 상태에 대한 자세한 내용은 MSDN 라이브러리의 JobState 열거형 참조하세요.
매개 변수 속성
| 형식: | JobState |
| Default value: | None |
| 허용되는 값: | NotStarted, Running, Completed, Failed, Stopped, Blocked, Suspended, Disconnected, Suspending, Stopping, AtBreakpoint |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
StateParameterSet
| Position: | 0 |
| 필수: | True |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
CommonParameters
이 cmdlet은 일반적인 매개 변수인 -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction 및 -WarningVariable 매개 변수를 지원합니다. 자세한 내용은 about_CommonParameters를 참조하세요.
입력
None
이 cmdlet에 입력을 파이프할 수 없습니다.
출력
System.Management.Automation.RemotingJob
이 cmdlet은 세션의 작업을 나타내는 개체를 반환합니다.
참고
작업의 PSJobTypeName 속성은 작업의 작업 유형을 나타냅니다. 속성 값은 작업 유형 작성자가 결정합니다. 다음 목록에는 일반적인 작업 유형이 나와 있습니다.
BackgroundJob
. Start-Job사용하여 로컬 작업을 시작했습니다. RemoteJob
. Invoke-Command cmdlet의 AsJob 매개 변수를 사용하여 PSSession 작업이 시작되었습니다. PSWorkflowJob
. AsJob 워크플로의 일반적인 매개 변수를 사용하여 작업을 시작했습니다.