{"id":14980380,"url":"https://github.com/theohbrothers/scheduledtaskmanagement","last_synced_at":"2025-10-29T00:30:27.599Z","repository":{"id":62231240,"uuid":"222874106","full_name":"theohbrothers/ScheduledTaskManagement","owner":"theohbrothers","description":"A PowerShell module for non-interactive management of Scheduled Tasks.","archived":false,"fork":false,"pushed_at":"2024-09-08T12:09:06.000Z","size":146,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T20:11:25.799Z","etag":null,"topics":["automation","devops","gitsubmodules","iac","infrastructure-as-code","infrastructureascode","mmc","non-interactive","powershell","powershell-gallery","powershell-module","psgallery","scheduled-task","scheduled-tasks","submodule","submodules","task-scheduler","task-scheduling","taskscheduler","windows-powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theohbrothers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-20T07:12:29.000Z","updated_at":"2024-09-08T12:09:09.000Z","dependencies_parsed_at":"2024-07-29T15:43:36.922Z","dependency_job_id":"48bc3250-4c56-4b1c-bb65-6caaf860d743","html_url":"https://github.com/theohbrothers/ScheduledTaskManagement","commit_stats":{"total_commits":151,"total_committers":1,"mean_commits":151.0,"dds":0.0,"last_synced_commit":"aae05de9fd6a26060bcf19b21c1061fb2c1ec88c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FScheduledTaskManagement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FScheduledTaskManagement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FScheduledTaskManagement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FScheduledTaskManagement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theohbrothers","download_url":"https://codeload.github.com/theohbrothers/ScheduledTaskManagement/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238743880,"owners_count":19523195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","devops","gitsubmodules","iac","infrastructure-as-code","infrastructureascode","mmc","non-interactive","powershell","powershell-gallery","powershell-module","psgallery","scheduled-task","scheduled-tasks","submodule","submodules","task-scheduler","task-scheduling","taskscheduler","windows-powershell"],"created_at":"2024-09-24T14:01:41.116Z","updated_at":"2025-10-29T00:30:27.246Z","avatar_url":"https://github.com/theohbrothers.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScheduledTaskManagement\n\n[![azuredevops-build](https://img.shields.io/azure-devops/build/theohbrothers/ScheduledTaskManagement/8/master.svg?label=build\u0026logo=azure-pipelines\u0026style=flat-square)](https://dev.azure.com/theohbrothers/ScheduledTaskManagement/_build?definitionId=8)\n[![github-release](https://img.shields.io/github/v/release/theohbrothers/ScheduledTaskManagement?style=flat-square)](https://github.com/theohbrothers/ScheduledTaskManagement/releases)\n[![powershellgallery-version](https://img.shields.io/powershellgallery/v/ScheduledTaskManagement?logo=powershell\u0026logoColor=white\u0026label=PSGallery\u0026labelColor=\u0026style=flat-square)](https://www.powershellgallery.com/packages/ScheduledTaskManagement)\n\n## Introduction\n\nA PowerShell module for non-interactive management of Scheduled Tasks.\n\n## Requirements\n\n* **Windows** with [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell).\n\n## Installation\n\nThe module can either be [*installed*](#via-install), or [*imported*](#via-import) from a local copy of this git repository.\n\n### via Install\n\n```powershell\n# Latest, for the current user\nInstall-Module -Name ScheduledTaskManagement -Repository PSGallery -Scope CurrentUser -Verbose\n\n# Specific version, for the current user\nInstall-Module -Name ScheduledTaskManagement -Repository PSGallery -RequiredVersion x.x.x -Scope CurrentUser -Verbose\n\n# Latest, for all users\nInstall-Module -Name ScheduledTaskManagement -Repository PSGallery -Scope AllUsers -Verbose\n```\n\nIf prompted to trust the repository, type `Y` and `enter`.\n\n### via Import\n\n```powershell\n# Clone the git repository\ngit clone https://github.com/theohbrothers/ScheduledTaskManagement.git\ncd ScheduledTaskManagement\\\n\n# Checkout version to use\ngit checkout vx.x.x\n\n# Import the module\nImport-Module .\\src\\ScheduledTaskManagement\\ScheduledTaskManagement.psm1 -Force -Verbose\n```\n\nThe module is now ready for use.\n\n## Usage\n\n### Scheduled tasks\n\nTo create or apply scheduled tasks, first define the properties of each task in `.ps1` or `.json` definition file(s). Then feed definition file path(s), definition directory path(s), or definition objects to `Setup-ScheduledTask` to create or apply them non-interactively.\n\nThe properties of definition objects are based off the parameters of the following cmdlets from the [`ScheduledTasks`](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks) module:\n\n* [`New-ScheduledTaskTrigger`](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasktrigger)\n* [`New-ScheduledTaskAction`](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtaskaction)\n* [`New-ScheduledTaskSettingsSet`](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasksettingsset)\n* [`New-ScheduledTaskPrincipal`](https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtaskprincipal)\n\nSeveral parameters such as [`-At`](https://learn.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasktrigger#-at) of `New-ScheduledTaskTrigger` involve values whose types prevent them from being expressed purely in non-PowerShell code. The module accounts for such values by enabling them to be intuitively yet declaratively defined even in [`.json`](docs/samples/definitions/scheduledtasks/tasks.sample.json#L49-L61) format. Those values will be *converted* into their relevant PowerShell types as part of a [serialization process](src/ScheduledTaskManagement/Private/Serialize-DefinitionObject.ps1#L19-L27) right before task creation or application. Through so, scheduled tasks can be managed as code as part of the practice of [Infrastructure-as-Code (IaC)](https://en.wikipedia.org/wiki/Infrastructure_as_code).\n\nSample definition files can be found [here](docs/samples/definitions/scheduledtasks).\n\n### Functions\n\n#### Parameters\n\n```powershell\nSetup-ScheduledTask -DefinitionFile \u003cstring[]\u003e [-AsJson] [\u003cCommonParameters\u003e]\nSetup-ScheduledTask -DefinitionDirectory \u003cstring[]\u003e [-AsJson] [\u003cCommonParameters\u003e]\nSetup-ScheduledTask -DefinitionObject \u003cObject[]\u003e [\u003cCommonParameters\u003e]\n```\n\n#### Examples\n\n```powershell\n# Via .ps1 definition file\nSetup-ScheduledTask -DefinitionFile \"C:\\path\\to\\definition.ps1\"\n\n# Via .json definition file\nSetup-ScheduledTask -DefinitionFile \"C:\\path\\to\\definition.json\" -AsJson\n\n# Via directory containing .ps1 definition file(s)\nSetup-ScheduledTask -DefinitionDirectory \"C:\\path\\to\\definition\\directory\\\"\n\n# Via directory containing .json definition file(s)\nSetup-ScheduledTask -DefinitionDirectory \"C:\\path\\to\\definition\\directory\\\" -AsJson\n\n# Via definition object(s)\n$tasks = . \"C:\\path\\to\\definition.ps1\"                                                                                                                          # From .ps1 definition file\n$tasks = Get-Content \"C:\\path\\to\\definition.json\" | ConvertFrom-Json | % { $_ }                                                                                 # From .json definition file\n$tasks = Get-ChildItem \"C:\\path\\to\\definition\\directory\\\" -File | ? { $_.Extension -eq '.ps1' } | % { . $_.FullName }                                           # From directory containing .ps1 definition file(s)\n$tasks = Get-ChildItem \"C:\\path\\to\\definition\\directory\\\" -File | ? { $_.Extension -eq '.json' } | % { Get-Content $_.FullName | ConvertFrom-Json | % { $_ } }  # From directory containing .json definition file(s)\n## Via parameter\nSetup-ScheduledTask -DefinitionObject $tasks\n## Via pipeline\n$tasks | Setup-ScheduledTask\n```\n\nTo list all available functions of the module:\n\n```powershell\nGet-Command -Module ScheduledTaskManagement\n```\n\n## Administration\n\n### Versions\n\nTo list versions of the module on `PSGallery`:\n\n```powershell\n# Latest\nFind-Module -Name ScheduledTaskManagement -Repository PSGallery -Verbose\n\n# All versions\nFind-Module -Name ScheduledTaskManagement -Repository PSGallery -AllVersions -Verbose\n```\n\nTo update the module (**Existing versions are left intact**):\n\n```powershell\n# Latest\nUpdate-Module -Name ScheduledTaskManagement -Verbose\n\n# Specific version\nUpdate-Module -Name ScheduledTaskManagement -RequiredVersion x.x.x -Verbose\n```\n\nTo uninstall the module:\n\n```powershell\n# Latest\nUninstall-Module -Name ScheduledTaskManagement -Verbose\n\n# All versions\nUninstall-Module -Name ScheduledTaskManagement -AllVersions -Verbose\n\n# To uninstall all other versions other than x.x.x\nGet-Module -Name ScheduledTaskManagement -ListAvailable | ? { $_.Version -ne 'x.x.x' } | % { Uninstall-Module -Name $_.Name -RequiredVersion $_.Version -Verbose }\n\n# Tip: Simulate uninstalls with -WhatIf\n```\n\n### Repositories\n\nTo get all registered PowerShell repositories:\n\n```powershell\nGet-PSRepository -Verbose\n```\n\nTo set the installation policy for the `PSGallery` repository:\n\n```powershell\n# PSGallery (trusted)\nSet-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose\n\n# PSGallery (untrusted)\nSet-PSRepository -Name PSGallery -InstallationPolicy Untrusted -Verbose\n```\n\n### Development\n\nTo import / re-import the module:\n\n```powershell\n# Installed version\nImport-Module -Name ScheduledTaskManagement -Force -Verbose\n\n# Project version\nImport-Module .\\src\\ScheduledTaskManagement\\ScheduledTaskManagement.psm1 -Force -Verbose\n```\n\nTo remove imported functions of the module:\n\n```powershell\nRemove-Module -Name ScheduledTaskManagement -Verbose\n```\n\nTo list imported versions of the module:\n\n```powershell\nGet-Module -Name ScheduledTaskManagement\n```\n\nTo list all installed versions of the module available for import:\n\n```powershell\nGet-Module -Name ScheduledTaskManagement -ListAvailable -Verbose\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheohbrothers%2Fscheduledtaskmanagement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheohbrothers%2Fscheduledtaskmanagement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheohbrothers%2Fscheduledtaskmanagement/lists"}