Versions Compared

Key

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

...

New-JobSchedulerHolidays -Select <String> -Days <Int32> -Interval <String> [-Weekdays <String[]>] [[-NonWorking
Weekdays] <String[]>] [-FromDate <DateTime>] -ToDate <DateTime> [-HolidayFiles <String[]>] [-OutputFile <String
>] -Append -Force <CommonParameters>

DESCRIPTION

...

-Weekdays <String[]>
Optionally specifies a list of weekdays for which jobs or job chains can be are not started, e.g.
due to run-time constraints.

The cmdlet will not create non-working days for the specified weekdays in order to avoid
redundancy as it is assumed that a run-time setting anyway excludes such dates.
When used with the -Force parameter then the cmdlet will generate such non-working days.

Weekdays kann be specified either by numbers 1..7 or by literals that are separated by a comma:

...

-NonWorkingWeekdays <String[]>
Optionally specifies a list of weekdays for which jobs or job chains cannot be started.are not started, e.g.
due to run-time constraints.

The cmdlet will not create non-working days for the specified weekdays in order to avoid
redundancy as it is assumed that a run-time setting anyway excludes such dates.
When used with the -Force parameter then the cmdlet will generate such non-working days.

Weekdays kann be specified either by numbers 1..7 or by literals that are separated by a comma:

...

-Append <SwitchParameter>
Optionally specifies the newly calculated non-working days to be appended
to an existing output file that is specified by use of the -OutputFile parameter.

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

Force

-Force <SwitchParameter>

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

...

C:\PS>New-JobSchedulerHolidays -Select first -Days 2 -Interval year -NonWorkingWeekdays 6,7 -ToDate '2018-12-31' -Force

Calculates the non-working days for the second woring kday working day of each year from the current date until end of 2018.
Saturday and Sunday are specified as non-working days and for which respective holiday dates are forced.

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

C:\PS>New-JobSchedulerHolidays -Select first -Days 3 -Interval quarter -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -
ToDate '2018-12-31' -Force

Calculates the non-working days for the third working day of each quarter from the specified date until end of 2018.

...

C:\PS>New-JobSchedulerHolidays -Select first -Days 3 -Interval month -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDate To
Date '2018-12-31' -Force

Calculates the non-working days for the third working day of each month from the specified date until end of 2018.

...

C:\PS>New-JobSchedulerHolidays -Select last -Days 3 -Interval quarter -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDate T
oDate '2018-12-31' -Force

Calculates the non-working days for the third last working day of each quarter from the specified date until end of 201
8.

...

C:\PS>New-JobSchedulerHolidays -Select last -Days 3 -Interval month -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDate ToD
ate '2018-12-31' -Force

Calculates the non-working days for the third last working day of each month from the specified date until end of 2018.

...

C:\PS>New-JobSchedulerHolidays -Select last -Days 3 -Interval year -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDate ToDa
te '2018-12-31' -Force

Calculates the non-working days for the third last working day of each year from the specified date until end of 2018.

...

C:\PS>New-JobSchedulerHolidays -Select last -Days 2 -Interval week -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDa
te '2018-12-31' -Force

Calculates the non-working days for the second last working day of each week (excluding Saturday and Sunday) from the s
pecified date until end of 2018.

...

New-JobSchedulerHolidays -Select first -Days 2 -Interval year -NonWorkingWeekdays 6,7 -FromDate '2016-01-01' -ToDate '20182
018-12-31' -HolidayFiles
$holidayFile

Calculates the non-working days for the second working day of each year from the specified date until end of 2018
and considers non-working days from a global holidays file.

No non-working days are created for Saturday and Sunday and for non-working days from the global holidays file.