Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Azure – Get VM Image List

Posted on April 6, 2016April 7, 2016 By David Kittell

When installing a new VM in Azure it’s helpful to know your options

Get-AzureVMImage | Select OS, label
( Get-AzureVMImage | where-object { $_.Label -like "Barracuda*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "CentOS*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "CoreOS*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "Debian*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "Oracle Linux*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "Red Hat*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "SUSE*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "Ubuntu*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName
( Get-AzureVMImage | where-object { $_.Label -like "Windows*" } )   | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName

Another example, say you are looking for a specific released version of Red Hat

( Get-AzureVMImage | where-object { $_.Label -like "Red Hat*"  -and $_.Location -like "*East US*" } )  | Sort-Object  PublishedDate  | FT -AutoSize -Wrap publishername,PublishedDate, Label, ImageName

This command currently comes up with this as a response

PublisherName PublishedDate        Label                        ImageName                                         
------------- -------------        -----                        ---------                                         
Red Hat       2/14/2016 3:00:00 AM Red Hat Enterprise Linux 6.7 a879bbefc56a43abb0ce65052aac09f3__rhel-67-20160214
Red Hat       2/14/2016 3:00:00 AM Red Hat Enterprise Linux 7.2 a879bbefc56a43abb0ce65052aac09f3__rhel-72-20160214
Red Hat       3/1/2016 11:00:00 AM Red Hat Enterprise Linux 6.7 a879bbefc56a43abb0ce65052aac09f3__rhel-67-20160302
Red Hat       3/1/2016 11:00:00 AM Red Hat Enterprise Linux 7.2 a879bbefc56a43abb0ce65052aac09f3__rhel-72-20160302

Get latest image

( Get-AzureVMImage | where-object { $_.Label -like "Red Hat*"  -and $_.Location -like "*East US*" } )  |  sort PublishedDate -Descending | select -ExpandProperty ImageName -First 1
Originally Posted on April 6, 2016
Last Updated on April 7, 2016
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Azure CentOS Code PowerShell Red Hat Ubuntu UNIX Windows

Post navigation

Previous post
Next post

Related Posts

Ektron Metrics – User Count By User Group

Posted on May 6, 2013October 26, 2015

Part of the Ektron Metrics Script, this query will help with metrics to give you an idea of how often your users login. SET NOCOUNT ON DECLARE @month INT ,@year INT ,@start_date DATETIME ,@end_date DATETIME SET @month = ( SELECT CASE WHEN MONTH(GETDATE()) = ‘1’ THEN ’12’ ELSE MONTH(GETDATE()) -…

Read More

Computer Details

Posted on September 17, 2013October 26, 2015

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ComputerDetails.aspx.cs" Inherits="ComputerName" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Computer Details</title> </head> <body> <form id="form1" runat="server"> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td> Windows User: </td> <td> <asp:TextBox ID="WindowsUser" runat="server" /> </td> </tr> <tr> <td> Machine Name: </td> <td> <asp:TextBox ID="MachineName"…

Read More

PHP WordPress – Use Radius Server Login

Posted on October 27, 2015November 19, 2015

Securing WordPress with Radius Server login. This project was created in mind to help secure WordPress but allow users an easier way to securely login without having to have a really long password to remember. While I do not go into creating the Radius server you can go to http://www.radiusdesk.com/getting_started/install_ubuntu_nginx…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes