Skip to content

xScheduledTask stop all running tasks at the end of repetition duration" ? #168

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

Closed
DevOpsBoondoggles opened this issue Jul 3, 2018 · 4 comments · Fixed by #437
Closed
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@DevOpsBoondoggles
Copy link

Details of the scenario you tried and the problem that is occurring:
Might just be being thick but is there no way to change the setting "stop all running tasks at the end of repetition duration"

The DSC configuration that is using the resource (as detailed as possible):
xscheduledtask 4.0.0.0 (xcomputermanagement)
Version of the Operating System and PowerShell the DSC Target Node is running:
server 2016 5.1
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
4.0.0.0

@johlju
Copy link
Member

johlju commented Jul 4, 2018

It seems that nobody implemented StopAtDurationEnd yet. 🙂 I looks like an Boolean property should be added that is called StopAtDurationEnd, and for reference, it seems the property is on the trigger under Repetition (get the current value with $trigger.Repetition.StopAtDurationEnd). Referencing Creating an idle trigger in PowerShell for Windows Task Scheduler.
But seems it does not exist a property on the New-ScheduledTaskTrigger? 🤔

Labeling this as enhancement and help wanted so that anyone in the community can run with this.

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Jul 4, 2018
@johlju
Copy link
Member

johlju commented Jul 4, 2018

@gabrielmccoll There won't be any new releases for xComputerManagement, so this should be added to ComputerManagementDsc.

@DevOpsBoondoggles
Copy link
Author

ahh thank you kindly , I didn't realise this was kaput. Guess I should update everywhere . Sadly I don't think I've got the skills to do this. Though if someone gives me pointers I'm happy to bash in and see

@johlju
Copy link
Member

johlju commented Jul 6, 2018

This resource seems a bit complex at first, but I would follow another similar property RepeatInterval to see how it works, and then make the new property work similar.

https://github.com/PowerShell/ComputerManagementDsc/blob/12f3a7e72dc8500c5ca529d384bb664a3e6fb50f/Modules/ComputerManagementDsc/DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1#L481-L486

But it is a bit of work adding unit tests and integration tests to the change too, but same goes here, look at similar properties tests and see how they are done.

If you want to give it a try we are happy to give pointers when needed. 🙂 Otherwise someone else in the community that need this might want to help with this.

/cc @PlagueHO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
2 participants