Created
December 8, 2017 17:44
-
-
Save timothywarner/8cfa77841ac288a4533b071a3b809626 to your computer and use it in GitHub Desktop.
Get-ARMVM
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
function Get-ARMVM | |
{ | |
$RGs = Get-AzureRMResourceGroup | |
foreach($RG in $RGs) | |
{ | |
$VMs = Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupName | |
foreach($VM in $VMs) | |
{ | |
$VMDetail = Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupName -Name $VM.Name -Status | |
$RGN = $VMDetail.ResourceGroupName | |
foreach ($VMStatus in $VMDetail.Statuses) | |
{ | |
$VMStatusDetail = $VMStatus.DisplayStatus | |
} | |
Write-Output "Resource Group: $RGN", ("VM Name: " + $VM.Name), "Status: $VMStatusDetail" `n | |
} | |
} | |
} |
I have pasted in runbook and tested after saving it. It shows completed but, not given any output.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello I have tried it using with the help of run book and started testing but it gives output as "This job does not have any output".
Is there any way to use this script?