Name
Get-JobSchedulerJobHistory
SYNOPSIS
Returns JobScheduler the task execution history items for jobs.
SYNTAX
Get-JobSchedulerJobHistory [[-Job] <String>] [[-JobChain] <String>] [[-OrderId] <String>] [[-Directory] <String>] [-Recursive] [[-CompactState] <String>] [[-WithLogDateFrom] <DateTime>] [[-DateTo] <DateTime>] [[-Timezone] <TimeZoneInfo>] [[-MaxLastHistoryItemsLimit] <Int32>] [-Successful] [-Failed] [-Incomplete] [<CommonParameters>]
DESCRIPTION
This cmdlet is deprecated as it is an alias for the Get-JobSchedulerJob cmdlet that
offers the same functionality when used with the -WithHistory switch. Therefore the
same functionality applies to both cmdlets.
Job history items are returned independently from the fact that the job is present in the JobScheduler Master.
Jobs are selected from a JobScheduler Master
* by the job chain that jobs are used with
* by an individual job
* by any jobs from a directory and optionally any sub-foldersJobSchedulerTaskHistory and is maintained
for compatibility reasons with previous versions of the PowerShell module.
PARAMETERS
Job
-Job <String>
Specifies the path and name of a job.
If the name of a job is specified then the -Directory parameter is used to determine the folder.
Otherwise the -Job parameter is assumed to include the full path and name of the job.
Required? | false |
Position? | 1 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
JobChain
-JobChain <String>
Optionally specifies the path and name of a job chain that includes jobs.
If the name of a job chain is specified then the -Directory parameter is used to determine the folder.
Otherwise the -JobChain parameter is assumed to include the full path and name of the job chain.
Required? | false |
Position? | 2 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
OrderId
-OrderId <String>
Required? | false |
Position? |
3 | |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Directory
-Directory <String>
Optionally specifies the folder for which jobs should be returned. The directory is determined
from the root folder, i.e. the "live" directory.
Required? | false |
Position? |
4 | |
Default value | / |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Recursive
-Recursive <SwitchParameter>
Specifies that sub-folders should be looked up if the -Directory parameter is used and no job or job chain is specified.
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Compact
State
-State <String>
Required? | false |
Position? | 5 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
DateFrom
-DateFrom <DateTime>
-Compact <SwitchParameter>
Specifies a more compact response with fewer job history attributes.
Required? | false |
Position? |
6 |
Default value |
(Get-Date -Hour 0 -Minute 0 -Second 0).ToUniversalTime() | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
...
DateTo
-WithLog <SwitchParameter>
Specifies the task log to be returned.
This operation is time-consuming and should be restricted to selecting individual jobs.DateTo <DateTime>
Required? | false |
Position? | 7 |
Default value | (Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(1).ToUniversalTime() |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Timezone
-Timezone <TimeZoneInfo>
Required? | false |
Position? |
8 |
Default value |
(Get-Timezone -Id 'UTC') | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
...
Limit
-MaxLastHistoryItems Limit <Int32>
Specifies the number of items that are returned from the history. Items are provided
in descending order starting with the latest history item.
Default: 1
Required? | false |
Position? | 9 |
Default value | 0 |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Successful
-Successful <SwitchParameter>
Required? | false |
Position? |
named |
Default value |
False | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Failed
-Failed <SwitchParameter>
Required? | false |
RELATED LINKS
EXAMPLES
-------------------------- EXAMPLE 1 --------------------------
PS > $history = Get-JobSchedulerJobHistory -JobChain /test/globals/job_chain1
Returns the latest job history item for all jobs used with the job chain "job_chain1" from the "/test/globals" folder.
-------------------------- EXAMPLE 2 --------------------------
PS > $history = Get-JobSchedulerJobHistory -JobChain /test/globals/job_chain1 -Job /test/globals/job1
Returns the latest job history item for the specified job that is associated with job chain "job_chain1" from the folder "/test/globals".
-------------------------- EXAMPLE 3 --------------------------
PS > $history = Get-JobSchedulerJobHistory -Job /test/globals/job1 -WithLog -MaxLastHistoryItems 5
Position? | named |
Default value | False |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Incomplete
-Incomplete <SwitchParameter>
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
RELATED LINKS
about_JobSchedulerReturns the latest 5 job history items for job "job1" from the folder "/test/globals" and includes the log output.