-
Notifications
You must be signed in to change notification settings - Fork 620
Update new-scheduledtasksettingsset.md #997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
|
@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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
JohanFreelancer9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy Review
|
@sukihanabi Please incorporate suggested copy changes into your PR. Thanks. |
- commit changes as suggested
nenonix
left a comment
There was a problem hiding this 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
-update as suggested
-changes commit as suggested
-changes commit as suggested
-changes commit as suggested
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
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.
#548
Step Taken:
-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