Versions Compared

Key

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

...

Get-JobSchedulerOrderHistory

SYNOPSIS

ReturnsJobScheduler Returns the order execution history items for ordersjob chains.

SYNTAX

Get-JobSchedulerOrderHistory [[-OrderId] <String>] [[-JobChain] <String>] [[-Directory] <String>] [-Recursive] [[-CompactDateFrom] <DateTime>] [[-DateTo] <DateTime>] [[-WithLogTimezone] <TimeZoneInfo>] [[-MaxLastHistoryItemsLimit] <Int32>] [-Successful] [-Failed] [-Incomplete] [<CommonParameters>]

DESCRIPTION

...

History information is returned for orders from a JobScheduler Master.
Order executions can be selected by job chain, order ID, folder, history status etc.

The history information retured includes start time, end time, return code etc.

PARAMETERS

OrderId

-OrderId <String>
Optionally specifies the path and name identifier of an order for which the history should be returned.
If the ID of an order is specified then the -Directory parameter is used to determine the folder.
Otherwise the -OrderId parameter is assumed to include the full path and ID of the orderto limit results to that order.
This parameter requires use of the -JobChain parameter.

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

JobChain

-JobChain <String>
Specifies Optionally specifies the path and name of a job chain for which order history items should be information is returned.
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.

One of the parameters -Directory or -JobChain has to be specified.

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

...

-Directory <String>
Optionally specifies the folder for which order history items jobs should be returned. The directory is determined
from the root folder, i.e. the "live" directory.

...

-Recursive <SwitchParameter>
Specifies that any sub-folders should be looked up if when used with the -Directory parameter is used.
By default no sub-folders will be looked up for jobs.

Required?false
Position?named
Default valueFalse
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?4
Default value(Get-Date -Hour 0 -Minute 0 -Second 0).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

DateTo

-Compact <SwitchParameter>DateTo <DateTime>
Specifies that fewer order history attributes will be returned. 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?named5
Default valueFalse(Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(1).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

Timezone

-WithLog <SwitchParameter>Timezone <TimeZoneInfo>
Specifies the order log timezone to be returned.
This operation is time-consuming and should be restricted to selecting individual orderswhich dates should be converted in the history information.
A timezone can e.g. be specified like this:

Get-JSOrderHistory -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-JSOrderHistory -Timezone (Get-Timezone)

Default: Dates are returned in UTC.

Required?false
Position?named6
Default valueFalse(Get-Timezone -Id 'UTC')
Accept pipeline input?falsetrue (ByPropertyName)
Accept wildcard characters?false

...

Limit

-MaxLastHistoryItems Limit <Int32>
Specifies the max. number of items that should be returned from the history. Items are provided
in descending order starting with the latest history entry.
Default: 1 history items of order 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 executed orders.

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

Failed

-Failed <SwitchParameter>
Returns history informiaton for failed orders.

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

Incomplete

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

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

...

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

PS > $history $items = Get-JobSchedulerOrderHistory

Returns today's order execution history for any orders.

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

PS > $items = Get-JobSchedulerOrderHistory -JobChain /test/globals/chain1-Timezone (Get-Timezone)

Returns today's order execution history for any orders with dates being converted to the local timezoneReturns the latest history item for job chain "chain1" from the folder "/test/globals".

-------------------------- EXAMPLE 2 3 --------------------------

PS > $history $items = Get-JobSchedulerOrderHistory -JobChain /test/globals/chain1 -OrderId order1Timezone (Get-Timezone -Id 'GMT Standard Time')

Returns today's order execution history for any orders with dates being converted to the GMT timezoneReturns the latest history item for order "order1" from the folder "/test/globals" with the job chain "chain1".

-------------------------- EXAMPLE 3 4 --------------------------

PS > $history $items = Get-JobSchedulerOrderHistory -JobChain /test/globals/chain1 -MaxLastHistoryItems 5jobChain1

Returns today's order execution history for a given job chain.

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

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

Returns the order execution history for any failed orders for the last seven daysReturns the 5 latest history items for the specified job chain and includes the log output.

-------------------------- EXAMPLE 4 6 --------------------------

PS > $history $items = Get-JobSchedulerOrderHistory -JobChain Directory /test /globals/chain1 -WithLog-Recursive -Succesful -Failed

Returns today's order execution history for any completed orders from the "/test" directory and any sub-folders recursivelyReturns the latest history item for the specified job chain and includes the log output.