Skip to content

Instantly share code, notes, and snippets.

@m-gagne
Last active October 24, 2023 12:47
Show Gist options
  • Save m-gagne/fa5787f048c0d3ab418f to your computer and use it in GitHub Desktop.
Save m-gagne/fa5787f048c0d3ab418f to your computer and use it in GitHub Desktop.
# Original author Mark Renoden (http://au.linkedin.com/in/markrenoden)
Get-AzureVM |
ForEach-Object {
$vm = $_.name;
Write-Output "$vm VM Properties";
Write-Output "---------------";
Format-List -InputObject $_ -Property *;
Write-Output "$vm VM Endpoints";
Write-Output "---------------" ;
Get-AzureEndpoint -VM $_;
Write-Output "$vm Virtual Disks";
Write-Output "---------------" ;
Get-AzureDisk |
where {$_.AttachedTo.RoleName -eq $vm};
Write-Output "==================================`n"
} |
Out-File -FilePath ".\myVMs.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment