Versions Compared

Key

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

...

Add-JobSchedulerEvent [-EventClass <String>] -EventId <String> [-ExitCode <Int32>] [-AllowedExitCode <Int32>AllowedExitCodes <Int32[]>] [-Job <String>] [-JobChain <String>] [-Order <String> <String
>]
[-MasterUrl <Uri>] [-SupervisorUrl <Uri>] [-SupervisorJobChain <String>] [-ExpirationDate <DateTime>] [-ExpirationCycle <String>] [-ExpirationPeriod <String>] [-NoExpiNoE
ration xpiration] [-Parameters <Hashtable>] <CommonParameters>

...

ExitCode

-ExitCode <Int32>
The current Specifies the exit code of the job script running. Assign $lastexitcode as a value
to specify the last non-zero exit code of a PowerShell script or command.that is added to the event. Usually this signals the execution status of a job,
however, you can assign a specific numeric exit code.

Without this parameter being used the $LastExitCode is implicitely assumed, i.e. the last exit code
that was provided from a command or program.

Consider that exit codes other than 0 signal failed execution. You can specify allowed exit codes
with the -AllowedExitCodes parameter.

Default: last script exit code or failed execution of previous command Default: the script exit code.

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

...

AllowedExitCodes

-AllowedExitCode <Int32>AllowedExitCodes <Int32[]>
Specifies a list of exit codes that signal that a job is considered as having run successfully.
This is useful if job scripts provide return values in the form of exit codes and these codes
should not be considered as errors. When adding an event then any exit codes that match one of the
allowed exit codes are set to 0.

A range of allowed exit codes is specified by e.g -AllowedExitCodes 1..4 or -AllowedExitCodes 1,2,3,4.

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

...

-Job <String>
Specifies the name of the job currently runningthat is assigned to the event.

Default: the current job name if the cmdlet is used by a job.

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

...

-JobChain <String>
Specifies the name of the current job chain that is assigned to the event.

Default: the current job chain name if the cmdlet is used by a job chain.

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

...

-Order <String>
Specifies the identifier of the current order assigned to the event.

Default: the current order identification (order id) if the cmdlet is used by a job chain.

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

...

-ExpirationDate <DateTime>
Specifies the point in time for which an event automatically expires: this parameter is considered by the
Event Processor. A specific point in time can be specified by use of the ISO date format, i.e. yyyy-MM-dd hhHH:mm:ss.
The value 'never' ensures that the event does not ever expire.

...

-ExpirationCycle <String>
Specifies the duration after time for which the event will expire in the current period.
Periods start at 00:00 and end at 24:00. An expiration period cycle of 0421:00
specifies that 9pm of the event will expire 4 hours starting from the current point in timecurrent cycle for event expiration.

Values are specified by use of the format hhHH:mm:ss.

The parameters -ExpirationDate, -ExpirationCycle, -ExpirationPeriod, -NoExpiration may not be used at the same time.

...

-ExpirationPeriod <String>
Specifies the time for duration after which the event will expire in the current period.
Periods start at 00:00 and end at 24:00. An expiration period of 2104:00
specifies 9pm of the current period for event expirationthat the event will expire 4 hours starting from the current point in time.

Values are specified by use of the format hhHH:mm:ss.

The parameters -ExpirationDate, -ExpirationCycle, -ExpirationPeriod, -NoExpiration may not be used at the same time.

...

-NoExpiration <SwitchParameter>
Specifies that an event will not expire. Such events have to be removed by event action scripts.

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

...

-Parameters <Hashtable>
Allows additional parameters for event handlers to be specified. Parameters are created using name-value
pairs from a hashmap as e.g. @{'name1'='value1'; 'name2'='value2'}.

Parameter names can be freely chosen and event handlers configured to
take account of values handed over. Any number of parameters can be added.

...

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

C:\PS>Add-Event -ExitCode $lastexitcode -EventClass daily_closing -EventId 12345678

Creates an event from the latest exit code, with the specified event class and event id.

...

C:\PS>Add-Event -EventClass daily_closing -EventId 12345678 -AllowedExitCodes 1..4

Creates an event with the specified event class and event id. The exit code is implicitely added
from the global $LastExitCode value. Should the exit code be contained in the list of
allowed exit codes then its value is set to 0.

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

C:\PS>Add-Event -EventClass daily_closing -EventId 12345678 -ExpirationPeriod 04:00

Creates an event that will expire 4 hrs. from now.

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

C:\PS>Add-Event -EventClass daily_closing -EventId 12345678 -ExpirationCycle 21:00

Creates an event that will expire at 9pm of the current day.

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

C:\PS>Add-Event -EventClass daily_closing -EventId 12345678 -ExpirationDate (Get-Date).AddDays(2)

Creates an event that will expire two days later.

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

C:\PS>Add-Event -EventClass daily_closing -EventId 12345678 -Parameters @{'name1'='value1'; 'name2'='value2'}

Creates an event with two additional parameters from a hashtable.