Created
October 25, 2016 15:02
-
-
Save anonymous/a47cd8229e8750bd6042bd7d156a64ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #List all locations and select one | |
| $location = (Get-AzureRmLocation).location | Out-GridView -Title "Select Azure location" -PassThru | |
| #List all publishers and select one | |
| $publisher = Get-AzureRmVMImagePublisher -Location $location | Select -ExpandProperty PublisherName | Out-GridView -Title "Select Publisher" -PassThru | |
| #Get all offers for selected publisher | |
| $Alloffers = @(Get-AzureRmVMImageOffer -Location $location -Publisher $publisher | Select -ExpandProperty Offer) | |
| #Get all images for all skus of all ofers for the selected publisher | |
| foreach ($Offer in $Alloffers) { | |
| $Allskus = (Get-AzureRmVMImageSku -Location $location -Publisher $publisher -Offer $offer | Select -ExpandProperty Skus) | |
| foreach ($sku in $Allskus) { | |
| $Allimages += @(Get-AzureRmVMImage -Location $location -PublisherName $publisher -Offer $offer -Skus $sku) | |
| } | |
| } | |
| #Wash and sort object | |
| $Allversions = $Allimages | select Version,Skus,Offer,PublisherName | Sort-Object Skus | |
| Write-Output $Allversions | |
| #$Allversions | Export-Csv c:\temp\All-Images-Skus-Offer.csv | |
| 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment