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
## Get the Azure Automation Acount Information | |
$azConn = Get-AutomationConnection -Name 'AzureRunAsConnection' | |
## Add the automation account context to the session | |
Add-AzureRMAccount -ServicePrincipal -Tenant $azConn.TenantID -ApplicationId $azConn.ApplicationId -CertificateThumbprint $azConn.CertificateThumbprint | |
## Get the Azure VMs with tags matching the value '6am' | |
$azVMs = Get-AzureRMVM | Where-Object {$_.Name -eq 'VM_NAME_HERE'} | |
## Start VMs |
OlderNewer