Skip to content
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

Add "Monthly" Trigger to ScheduledTask #419

Open
ephos opened this issue Aug 25, 2023 · 4 comments
Open

Add "Monthly" Trigger to ScheduledTask #419

ephos opened this issue Aug 25, 2023 · 4 comments
Labels
needs more information The issue needs more information from the author or the community.

Comments

@ephos
Copy link

ephos commented Aug 25, 2023

Request:
ScheduledTask does not allow the ability to do a monthly trigger, with this functionality missing it makes it difficult to use DSC to create a task that runs on a specific day each month. This resource lacks feature parity with it's PowerShell/GUI alternatives.

Use case example:
Run a task on the 3rd Monday of each month.

Additional Notes:
This can be worked around somewhat by the suggestions in #173 but having to manage doing this through logic external to the resource seems counter productive to using something declarative like DSC.

@johlju
Copy link
Member

johlju commented Dec 4, 2023

Can't this be accomplished with the WeeksInterval parameter and have the ScheduleType set to Weekly?

How would you otherwise set a monthly trigger using the PowerShell commands?

@johlju johlju added the needs more information The issue needs more information from the author or the community. label Dec 4, 2023
@Borgquite
Copy link
Contributor

Borgquite commented Nov 29, 2024

Running into these issues when trying to resolve this using the Get-CimClass / New-CimInstance process that's working well already for OnIdle, OnEvent, AtCreation and OnSessionState

PowerShell/PowerShell#7292

At present until any underlying PowerShell issue is resolved, it looks like it might only be possible by using a COM Object, or shelling out to schtasks.exe (yuck!)

https://web.archive.org/web/20161026024255/https://www.slightfuture.com/devel/idle-task-scheduler-powershell
https://stackoverflow.com/questions/58455215/create-monthly-trigger-for-scheduled-task-in-powershell-with-additional-criteri
https://stackoverflow.com/questions/34799923/powershell-monthly-scheduled-task-trigger

@johlju
Copy link
Member

johlju commented Nov 29, 2024

Probably wont help, but look at the #Fringe channel on Discord (same place as #DSC channel). ScheduleTask was mentioned there yesterday or the day before in relations to the problem with not all API are surfaced. Good source for deep learning if nothing else 😊

@Borgquite
Copy link
Contributor

@johlju Just posted. Let’s see if I’ve missed a trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more information The issue needs more information from the author or the community.
Projects
None yet
Development

No branches or pull requests

3 participants