Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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