Name

Get-JobSchedulerJobStreamHistory

SYNOPSIS

Returns the execution history for job streams.

SYNTAX

Get-JobSchedulerJobStreamHistory [[-JobStream] <String>] [[-DateFrom] <DateTime>] [[-DateTo] <DateTime>] [[-RelativeDateFrom] <String>] [[-RelativeDateTo] <String>] [[-Timezone] <TimeZoneInfo>] [[-Limit] <Int32>] [-Successful] [-Failed] [-Incomplete] [-WithTasks] [<CommonParameters>]

DESCRIPTION

History information is returned for job streams from a JobScheduler Master.
Job stream executions can be selected by job stream name, history status etc.

The history information returned includes start time, end time, tasks etc.

PARAMETERS

JobStream

-JobStream <String>
Optionally specifies the path and name of a job stream. Such names are unique across
all folders that job streams are stored to.

Required?false
Position?1
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

DateFrom

-DateFrom <DateTime>
Specifies the date starting from which history items should be returned.
Consider that a UTC date has to be provided.

Default: Begin of the current day as a UTC date

Required?false
Position?2
Default value(Get-Date -Hour 0 -Minute 0 -Second 0).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

DateTo

-DateTo <DateTime>
Specifies the date until which history items should be returned.
Consider that a UTC date has to be provided.

Default: End of the current day as a UTC date

Required?false
Position?3
Default value(Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(1).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

RelativeDateFrom

-RelativeDateFrom <String>
Specifies a relative date starting from which history items should be returned, e.g.

* -1d, -2d: one day ago, two days ago
* -1w, -2w: one week ago, two weeks ago
* -1M, -2M: one month ago, two months ago
* -1y, -2y: one year ago, two years ago

Optionally a time offset can be specified, e.g. -1d+02:00, as otherwise midnight UTC is assumed.
Alternatively a timezone offset can be added, e.g. by using -1d+TZ, that is calculated by the cmdlet
for the timezone that is specified with the -Timezone parameter.

This parameter takes precedence over the -DateFrom parameter.

Required?false
Position?4
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

RelativeDateTo

-RelativeDateTo <String>
Specifies a relative date until which history items should be returned, e.g.

* -1d, -2d: one day ago, two days ago
* -1w, -2w: one week ago, two weeks ago
* -1M, -2M: one month ago, two months ago
* -1y, -2y: one year ago, two years ago

Optionally a time offset can be specified, e.g. -1d+02:00, as otherwise midnight UTC is assumed.
Alternatively a timezone offset can be added, e.g. by using -1d+TZ, that is calculated by the cmdlet
for the timezone that is specified with the -Timezone parameter.

This parameter takes precedence over the -DateFrom parameter.

Required?false
Position?5
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Timezone

-Timezone <TimeZoneInfo>
Specifies the timezone to which dates should be converted in the history information.
A timezone can e.g. be specified like this:

Get-JSJobStreamHistory -Timezone (Get-Timezone -Id 'GMT Standard Time')

All dates in JobScheduler are UTC and can be converted e.g. to the local time zone like this:

Get-JSJobStreamHistory -Timezone (Get-Timezone)

Default: Dates are returned in UTC.

Required?false
Position?6
Default value(Get-Timezone -Id 'UTC')
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Limit

-Limit <Int32>
Specifies the max. number of history items for job stream executions to be returned.
The default value is 10000, for an unlimited number of items the value -1 can be specified.

Required?false
Position?7
Default value0
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Successful

-Successful <SwitchParameter>
Returns history information for successfully completed job streams.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Failed

-Failed <SwitchParameter>
Returns history informiaton for failed job streams.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Incomplete

-Incomplete <SwitchParameter>
Specifies that history information for running job streams should be returned.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

WithTasks

-WithTasks <SwitchParameter>
Specifies that to the history information that is returned an additional record for each task is added.
This allows to receive the list of tasks executed for each job stream in the order of their start time.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

about_JobScheduler

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory

Returns today's execution history for any job streams.

-------------------------- EXAMPLE 2 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -Timezone (Get-Timezone)

Returns today's execution history for any job streams with dates being converted to the local timezone.

-------------------------- EXAMPLE 3 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -Timezone (Get-Timezone -Id 'GMT Standard Time')

Returns today's execution history for any job streams with dates being converted to the GMT timezone.

-------------------------- EXAMPLE 4 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -JobStream /test/globals/jobstream1

Returns today's execution history for a given job stream.

-------------------------- EXAMPLE 5 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -Successful -DateFrom "2020-08-11 14:00:00Z"

Returns the execution history for successfully completed job streams that started after the specified UTC date and time.

-------------------------- EXAMPLE 6 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -RelativeDateFrom -7d

Returns the job stream execution history for the last seven days. The history is reported starting from midnight UTC.

-------------------------- EXAMPLE 7 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -RelativeDateFrom -7d+01:00

Returns the job stream execution history for the last seven days. The history is reported starting from 1 hour after midnight UTC.

-------------------------- EXAMPLE 8 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -RelativeDateFrom -7d+TZ

Returns the job stream execution history for any jobs for the last seven days. The history is reported starting from midnight in the same timezone that is used with the -Timezone parameter.

-------------------------- EXAMPLE 9 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -RelativeDateFrom -1w

Returns the job stream execution history for the last week.

-------------------------- EXAMPLE 10 --------------------------

PS > $items = Get-JobSchedulerJobStreamHistory -Failed -DateFrom (Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(-7).ToUniversalTime()

Returns the execution history for any failed job streams for the last seven days.

  • No labels