Skip to content

Instantly share code, notes, and snippets.

@desek
Created November 27, 2014 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desek/80022d7cd4588d86c86d to your computer and use it in GitHub Desktop.
Save desek/80022d7cd4588d86c86d to your computer and use it in GitHub Desktop.
Assign Schedule(s) to Runbook
# Set Azure Automation Account Name
$PSDefaultParameterValues += @{"*-AzureAutomation*:AutomationAccountName"=$AzureAutomationAccount.AutomationAccountName}
# Select one Runbook
$Runbook = Get-AzureAutomationRunbook | Out-GridView -PassThru
# Select one/multiple Schedule(s)
$Schedules = Get-AzureAutomationSchedule | Out-GridView -PassThru
# Assign Schedules to Runbook
$Schedules | ForEach-Object { Register-AzureAutomationScheduledRunbook -Name $Runbook.Name -ScheduleName $_.Name -Verbose }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment