Skip to content

Instantly share code, notes, and snippets.

@artisticcheese
Created September 17, 2021 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisticcheese/f15c283e769e1a2006f3fadca307daf9 to your computer and use it in GitHub Desktop.
Save artisticcheese/f15c283e769e1a2006f3fadca307daf9 to your computer and use it in GitHub Desktop.
get-extension.ps1
Get-AzVM | `
where-object {$_.storageprofile.Osdisk.OSType -eq 'Linux'} | `
ForEach-Object {$out = @()} {$a = [pscustomobject]@{Name = $_.Name; Version = (Get-azVM -status -VMName $_.Name -ResourceGroupName $_.ResourceGroupName).Extensions.Where({$_.Name -match 'OMS'}).TypeHandlerVersion; ResourceGroupName = $_.ResourceGroupName}; $out+=$a}; $out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment