Feature Request - Automations Jobs and Schedules

Product: PowerShell Universal
Version: 5.5.3

In our environment, each developer has their own development server running a developer license, pointing to their own git branch, which flows up to the stage branch, which our QA PSU servers are connected to, and that flows up to our main branch, which our production PSU servers point to.

Well, the problem is job schedules. Let’s say another developer works on and adds an automation that runs on a schedule, and it makes its way into production when I pull down the latest changes into my dev branch, that job tries to run in my dev environment. Well, that isn’t desirable most of the time because my dev server doesn’t have the right environment variables, the required database running locally, or whatever.

It would be nice to enable or disable jobs and have that stored in the DB instead of a file that gets pushed into git.

That would also allow us to temporarily disable jobs in prod which isn’t allowed to write changes to git.

I would also be open to any other suggestions on how to handle this. There might be a better way to handle this that I am not aware of.

I think what you want is to add either the computer param or add a condition?

$Parameters = @{
    Cron      = "0 */8 * * *"
    Script    = "Check-Files.ps1"
    TimeZone  = "America/Chicago"
    Name      = "Some script"
    Condition = {
        $Environment -eq 'production'
    }
    Computer  = "ProdComputer"
}
New-PSUSchedule @Parameters
1 Like

Thank you, that is exactly what I needed!