Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # Retrieve the resource group information
  2. [array]$ResourceGroupArray = Get-AzureRMVm | Select-Object -Property ResourceGroupName, Name, VmId
  3.  
  4. foreach ($resourceGroup in $ResourceGroupArray){
  5. $targetResourceId = (Get-AzureRmVM -ResourceGroupName $resourcegroup.ResourceGroupName -Name $resourceGroup.Name).Id
  6. $shutdownInformation = Get-AzureRmResource -ResourceGroupName $resourcegroup.ResourceGroupName -ResourceType Microsoft.DevTestLab/schedules | ft -Property ResourceGroupName, Name
  7. Write-Host "ID: " $targetResourceId
  8. $shutdownInformation
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement