Last active
October 2, 2023 12:44
-
-
Save mikefrobbins/73757ca0c9c098d02e0758921a0d48d0 to your computer and use it in GitHub Desktop.
Status of Azure VM Image
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
<# | |
Prerequisites | |
An Azure subscription is required. | |
Install the Az PowerShell module from the PowerShell Gallery: | |
Install-Module -Name Az | |
Login to Azure: | |
Connect-AzAccount | |
#> | |
$subscriptionId = (Get-AzSubscription).Id | |
Invoke-AzRestMethod -Uri "https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Compute/locations/westeurope/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2016-Datacenter/versions/14393.3866.2008081933?api-version=2023-07-01" -OutVariable results | |
($results.Content | ConvertFrom-Json -AsHashtable).values | Select-Object -Property @{label='ImageName';expression={$_.message -replace '^.*Sku: |,.*$'}}, @{label='Status';expression={$_.code}} |
irwins
commented
Oct 2, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment