Skip to content

Task Scheduler, New-ScheduledTaskTrigger, missing examples for Delay, ExecutionTimeLimit, make it use local time and so on.. #2949

Open
@Joachim-Otahal

Description

@Joachim-Otahal

Example for Delay and ExecutionTimeLimit :

$TaskTrigger = New-ScheduledTaskTrigger -AtLogOn
$TaskTrigger.Delay = "PT1M"
$TaskTrigger.ExecutionTimeLimit = "PT18M"

Missing: Where is the "PT1M" format documented? I had to get this out of an exported XML.

Set the starttime to be LOCAL time instead of UTC, missing as well:

$TaskTrigger = New-ScheduledTaskTrigger -Daily -At "04:05"
$TaskTrigger.StartBoundary = [DateTime]::Parse($TaskTrigger.StartBoundary).ToLocalTime().ToString("s")

Example for "Do task until date X, AND use LOCAL TIME", missing as well:

$TaskTrigger.EndBoundary = ((Get-Date).AddDays(20).ToLocalTime()).ToString("s")

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

area-scheduledtasksIssues for scheduledtasks moduleissue-doc-bugSomething is out of date, unclear, confusing, or broken in the article. Blocks customer success.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions