Simon Vedder

Cloud Engineer · Zürich

Show-VmPowerScheduleCalendar

Print the next few days of a schedule, so a mistake is something you read rather than survive

Required permissionsNone. This command computes times in memory.

Most schedule mistakes are not syntax errors. They are “I did not think about the Sunday”, or “07:30 in which time zone”, or a daylight saving change nobody pictured. A schema validator finds none of those. A printed calendar finds all three.

It computes occurrences with the same function the decision engine uses. A preview produced by different code from the one that runs is a preview that eventually lies.

Both daylight saving cases are visible in the Note column rather than being smoothed away: an action that fell into the spring gap shows as shifted, and one in the doubled autumn hour shows as ambiguous.

Syntax

Show-VmPowerScheduleCalendar [-Schedule] <Object[]> [[-Days] <int>] [[-FromUtc] <datetime>] [<CommonParameters>]

Requirements

PrerequisitesPowerShell 7.2 or later.
WritesNothing.

Parameters

NameTypeRequiredPipelineDefaultDescription
-ScheduleObject[]yesyesOne or more schedules, in either form.
-DaysInt32nono14How many calendar days to render, counting the one you are in - not a rolling window of that many hours. At 16:00 with -Days 1 you see the rest of today and nothing of tomorrow, which is why the default is a fortnight: a wrong weekday only shows over a span that contains it.
-FromUtcDateTimenono[datetime]::UtcNowStart of the window. Defaults to now, and can be set to look at a specific date - a daylight saving weekend, for instance.

Examples

Example 1

# What will this actually do?
New-VmPowerSchedule -Name office-hours-ch -TimeZone 'Europe/Zurich' -Weekdays '07:30-18:30' |
    Show-VmPowerScheduleCalendar

Example 2

# Look straight at the daylight saving weekend rather than waiting for it
$s | Show-VmPowerScheduleCalendar -FromUtc ([datetime]'2026-03-28T00:00:00Z') -Days 3

Example 3

# Everything in the catalogue, one table
Get-VmPowerSchedule -ResourceGroupName rg-vmpower -AutomationAccountName aa-vmpower |
    Show-VmPowerScheduleCalendar -Days 7 | Format-Table Schedule, DayOfWeek, LocalTime, Action, Note

Output

  • AzureVMPowerManagement.VmPowerOccurrence

Generated from the comment-based help in the module. Same text as Get-Help Show-VmPowerScheduleCalendar -Full, and as the copy on GitHub.