Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Retrieve the resource group information
- [array]$ResourceGroupArray = Get-AzureRMVm | Select-Object -Property ResourceGroupName, Name, VmId
- foreach ($resourceGroup in $ResourceGroupArray){
- $targetResourceId = (Get-AzureRmVM -ResourceGroupName $resourcegroup.ResourceGroupName -Name $resourceGroup.Name).Id
- $shutdownInformation = Get-AzureRmResource -ResourceGroupName $resourcegroup.ResourceGroupName -ResourceType Microsoft.DevTestLab/schedules | ft -Property ResourceGroupName, Name
- Write-Host "ID: " $targetResourceId
- $shutdownInformation
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement