Created
April 9, 2015 12:34
-
-
Save mgreenegit/420f7f6e378c9f60f193 to your computer and use it in GitHub Desktop.
Kick off an Azure Automation Runbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Run { | |
param ( | |
[parameter (mandatory = $true, valuefrompipeline = $true)] | |
[system.string]$Runbook, | |
[system.string]$AutomationAccount | |
) | |
if (!(Get-Module Azure)) {ipmo 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1'} | |
if (!$AutomationAccount) {$AutomationAccount = Get-AzureAutomationAccount | % AutomationAccountName} | |
Start-AzureAutomationRunbook -Name $Runbook -AutomationAccountName $AutomationAccount | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several things need to be added. Prompt for account, etc.