Simon Vedder

Cloud Engineer · Zürich

Remove-VmPowerSchedule

Take a schedule out of the custom catalogue

Required permissionsMicrosoft.Automation/automationAccounts/variables/write and /read on the Automation Account.

Removes from PM_ScheduleCatalogCustom only. A schedule that came from the deployment cannot be removed here, because the deployment would put it back on the next run and the removal would look like it had failed. Removing an override reveals the deployment’s version again rather than deleting anything.

Machines still tagged with a name that no longer resolves are not left in limbo: they are reported as ScheduleNotInCatalogue on the next plan, which is a decision to do nothing with a reason attached, not a silent one. This command names them before it removes anything.

Syntax

Remove-VmPowerSchedule [-Name] <string[]> -ResourceGroupName <string> -AutomationAccountName <string> [-SubscriptionId <string>] [-WhatIf] [-Confirm] [<CommonParameters>]

Requirements

PrerequisitesPowerShell 7.2 or later and Az.Accounts.
WritesThe Automation variable PM_ScheduleCatalogCustom.

Parameters

NameTypeRequiredPipelineDefaultDescription
-NameString[]yesyesSchedules to remove.
-ResourceGroupNameStringyesnoResource group holding the Automation Account.
-AutomationAccountNameStringyesnoThe Automation Account.
-SubscriptionIdStringnonoSubscription holding the account. Defaults to the current context.

Supports -WhatIf and -Confirm.

Examples

Example 1

# Drop an override and let the shipped example apply again
Remove-VmPowerSchedule -Name office-hours-ch -ResourceGroupName rg-vmpower -AutomationAccountName aa-vmpower

Example 2

# See what would happen first
Remove-VmPowerSchedule -Name night-shift -ResourceGroupName rg-vmpower -AutomationAccountName aa-vmpower -WhatIf

Output

  • None

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