I’m writing a PowerShell Runbook that will schedule the execution of a Runbook using the New-AzAutomationSchedule call. However, no matter how I enter the time, it still adjusts it to UTC.
Here’s specifically what’s happening…
New-AzAutomation -AutomationAccountName $AccountName -ResourceGroupName $RGName -Name $Name -DayInterval 1 -StartTime "0800"
Schedules my job for 8AM UTC.
New-AzAutomation -AutomationAccountName $AccountName -ResourceGroupName $RGName -Name $Name -DayInterval 1 -StartTime "0800" -TimeZone "America/Chicago"
Schedules my job for 3AM Central Time.
What I want is it to be 8AM Central Time and I don’t want to have to manually calculate whether it’s daylight savings or not, ideally. Using CoPilot, ChatGPT 4o, and Claude 3 have given me some really convoluted code that I would hope is not necessary.
I’ve also tried adding the “Z” to the StartTime, but I get the same results.
I am using the PowerShell 5.1 runtime because I need to use the SqlServer module and that isn’t working properly for PowerShell 7.1 or 7.2 runtimes (that’s an active issue I’m working with Microsoft support on – looks like others have this same problem).
I’m sure I’m either doing something really stupid, or I’m running into a quick of Azure Automation. Any help point me in the right direction would be appreciated. Thank you!
Curt Crandall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.