Skip to content

Conversation

@sukihanabi
Copy link
Contributor

#548
Step Taken:

  • Added Fixed the description for Example 1 #6 example to -ExecutionTimeLimit
    -ExecutionTimeLimit (New-TimeSpan -Hours 1) same as ExecutionTimeLimit = 'PT1H'
    it specify that if the task is not finished after 1 hour, it is considered as failed, it need to finish the task after 1 hour.

-Also added that "Without the ExecutionTimeLimit setting defined the time limit set to it's default of 3 days for the Task Scheduler is allowed to complete the task."
-added article for time limit parameter https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-6

References;
https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

The -ExecutionTimeLimit parameter is for New-ScheduledTaskSettingsSet command.
https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

Trigger task scheduler Job from powershell
https://stackoverflow.com/questions/44491658/trigger-task-scheduler-job-from-powershell?rq=1

Step Taken: 
- Added MicrosoftDocs#6 example to -ExecutionTimeLimit 
-ExecutionTimeLimit (New-TimeSpan -Hours 1) same as ExecutionTimeLimit =  'PT1H'
it specify that if the task is not finished after 1 hour, it is considered as failed, it need to finish the task after 1 hour.

-Also added that "Without the ExecutionTimeLimit setting defined the time limit set to it's default of 3 days for the Task Scheduler is allowed to complete the task."
-added article for time limit parameter https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-6

References;
https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

The -ExecutionTimeLimit parameter is for New-ScheduledTaskSettingsSet command.
https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

https://social.technet.microsoft.com/Forums/en-US/26be656a-ce4f-4566-a994-0e0c2edabac8/windows-task-scheduler-time-limit-set-to-unlimited?forum=winserver8gen

Trigger task scheduler Job from powershell
https://stackoverflow.com/questions/44491658/trigger-task-scheduler-job-from-powershell?rq=1
@o0nj
Copy link
Contributor

o0nj commented Apr 19, 2019

@nenonix @JohanFreelancer9 Copy editing is needed for this PR. Thanks.

The third command registers the scheduled task Task01 to run the task action named Cmd only then finish the task after 1 hour.
PS C:\>Register-ScheduledTask Task01 -Action $Sta -Settings $Stset
```
Without the ExecutionTimeLimit setting defined the time limit set to it's default of 3 days for the Task Scheduler is allowed to complete the task. To configure the time limit, see [New-TimeSpan](https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-6).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Without the ExecutionTimeLimit setting defined the time limit set to it's default of 3 days for the Task Scheduler is allowed to complete the task. To configure the time limit, see [New-TimeSpan](https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-6).
Without the ExecutionTimeLimit setting defined, the time limit set to its default of three days for the Task Scheduler is allowed to complete the task. To configure the time limit, see [New-TimeSpan](https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-6).

```
PS C:\>$Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that specify if the task is not finished after 1 hour, it is considered as failed. This command assigns the **ScheduledTaskSettings** object to the $Stset variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The second command creates scheduled task settings that specify if the task is not finished after 1 hour, it is considered as failed. This command assigns the **ScheduledTaskSettings** object to the $Stset variable.
The second command creates scheduled task settings that specify if the task is not finished after one hour, it is considered as failed. This command assigns the **ScheduledTaskSettings** object to the $Stset variable.

The second command creates scheduled task settings that specify if the task is not finished after 1 hour, it is considered as failed. This command assigns the **ScheduledTaskSettings** object to the $Stset variable.
$Stset = New-ScheduledTaskSettingsSet -ExecutionTimeLimit (New-TimeSpan -Hours 1)
The third command registers the scheduled task Task01 to run the task action named Cmd only then finish the task after 1 hour.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The third command registers the scheduled task Task01 to run the task action named Cmd only then finish the task after 1 hour.
The third command registers the scheduled task Task01 to run the task action named Cmd only, then finish the task after one hour.

Copy link
Contributor

@JohanFreelancer9 JohanFreelancer9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy Review

@o0nj
Copy link
Contributor

o0nj commented Apr 21, 2019

@sukihanabi Please incorporate suggested copy changes into your PR. Thanks.

- commit changes as suggested
Copy link
Contributor

@nenonix nenonix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with copy review

sukihanabi and others added 9 commits April 24, 2019 20:53
-changes commit as suggested
-changes commit as suggested
-changes commit as suggested
-removed # on the comment
For PR: MicrosoftDocs#997, is this correct?

All example 1-6 has the same 1st cmdlet: " PS C:\>$Sta = New-ScheduledTaskAction -Execute "Cmd" "

Commit change:
I added, this " The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the $Sta variable.
 " in every first line after the blocks of the cmdlet example.
-commit change as advised
@AndreaBarr AndreaBarr merged commit c9c9630 into MicrosoftDocs:master May 7, 2019
velkovb pushed a commit to velkovb/windows-powershell-docs that referenced this pull request May 28, 2019
For PR: MicrosoftDocs#997, is this correct?

All example 1-6 has the same 1st cmdlet: " PS C:\>$Sta = New-ScheduledTaskAction -Execute "Cmd" "

Commit change:
I added, this " The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the $Sta variable.
 " in every first line after the blocks of the cmdlet example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants