external help file | Module Name | online version | schema |
---|---|---|---|
PSDates-help.xml |
PSDates |
2.0.0 |
Get the next occurrence for a crontab
Get-CronNextOccurrence [-Crontab] <String> [[-StartTime <DateTime>]] [[-EndTime <DateTime>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
This function will either return the next occurrence, or if an end date is supplied, it will return all the occurrences between the start and end date.
Get-CronNextOccurrence -Crontab '0 17 * * *'
Will return the next occurrence of the crontab from the current time
$Date = Get-Date '12/14/2032'
Get-CronNextOccurrence -Crontab '0 17 * * *' -StartTime $Date
Will return the next occurrence of the crontab from the time provided
Get-CronNextOccurrence -Crontab '0 17 * * *' -StartTime $Date -EndTime $Date.AddDays(3)
Will return the all occurrences of the crontab between the two times
A valid crontab string
Type: String
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (All) False (None)
Position: 0
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
The datetime object to stop finding occurrences for from the StartTime
Type: DateTime
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: 2
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Accepted values:
Required: True (None) False (All)
Position: Named
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
The datetime object to find the next occurrence from. Uses current time if not supplied.
Type: DateTime
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: 1
Default value: (Get-Date)
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Fill Related Links Here