Created
September 21, 2016 23:32
-
-
Save marckean/c6bd0975b93959aec362f56d656686cd to your computer and use it in GitHub Desktop.
This file contains 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
workflow StartAzurePlaylistVMs | |
{ | |
$Cred = Get-AutomationPSCredential -Name "PowerShell SvcAcct" | |
Login-AzureRmAccount -Credential $Cred | |
$subscription = Get-AutomationVariable -Name "subscription" | |
Select-AzureRmSubscription -SubscriptionName $subscription | |
$VMs = Get-AzureRmVM | where {$_.Name -match 'playlist'} | |
ForEach -Parallel ($VM in $VMs) | |
{ | |
Start-AzureRmVM -Name $VM.Name -ResourceGroupName $VM.ResourceGroupName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment