Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get-JobSchedulerTaskHistory [[-Job] <String>] [[-JobChain] <String>] [[-OrderId] <String>] [[-Directory] <String>] [-Recursive] [[-State] <String>] [[-ExcludeJob] <String[]>] [[-RegEx] <String>] [[-DateFrom] <DateTime>] [[-DateTo] <DateTime>] [[-RelativeDateFrom] <String>] [[-RelativeDateTo] <String>] [[-Timezone] <TimeZoneInfo>] [[-TaskId] <Int32[]>] [[-Limit] <Int32>] [-Successful] [-Failed] [-Incomplete] [<CommonParameters>]

...

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

* -1s, -2s: one second ago, two seconds ago
* -1m, -2m: one minute ago, two minutes ago
* -1h, -2h: one hour ago, two hours ago
* -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.

...

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

* -1s, -2s: one second ago, two seconds ago
* -1m, -2m: one minute ago, two minutes ago
* -1h, -2h: one hour ago, two hours ago
* -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 -DateTo DateFrom parameter.

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

...

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

TaskId

-TaskId <Int32[]>

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

...

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

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

...

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

about_jobschedulerJobScheduler

EXAMPLES

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

...

PS > $items = Get-JobSchedulerTaskHistory -Job /testsos/globalsdailyplan/job1CreateDailyPlan

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

...

PS > $items = Get-JobSchedulerTaskHistory -JobChain /testsos/globalsdailyplan/job_chain1CreateDailyPlan

Returns today's task execution history for jobs in the given job chain.

...

-------------------------- EXAMPLE 11 --------------------------

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

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

-------------------------- EXAMPLE 12 --------------------------

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

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

-------------------------- EXAMPLE 13 --------------------------

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

Returns the task 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 12 14 --------------------------

...

Returns the task execution history for any jobs during the last week.

-------------------------- EXAMPLE 13 15 --------------------------

PS > $items = Get-JobSchedulerTaskHistory -Directory /test sos -Recursive -Succesful Successful -Failed

Returns today's task execution history for any completed tasks from the "/testsos" directory and any sub-folders recursively.