-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathaz-win-images.ps1
More file actions
54 lines (40 loc) · 1.73 KB
/
az-win-images.ps1
File metadata and controls
54 lines (40 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<# CIAOPS
Script provided as is. Use at own risk. No guarantees or warranty provided.
Description
Script designed to display available Windows IaaS Images
Prerequisites = 1
1. Ensure azurerm module installed or updated
ensure that install-azurerm msonline has been run
ensure that update-azurerm msonline has been run to get latest module
Module = https://www.powershellgallery.com/packages/AzureRM/
Latest version 6.13.1 21 November 2018
Allow custom scripts to run just for this instance
set-executionpolicy -executionpolicy bypass -scope currentuser -force
#>
## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$errormessagecolor = "red"
$warnmessagecolor = "yellow"
$location = "westus2" ## Azure region to check
$pubName = "MicrosoftWindowsServer"
$offerName = "WindowsServer"
Clear-Host
write-host -foregroundcolor $systemmessagecolor "Script started`n"
## Names of all VM image publishers
write-host -foregroundcolor $processmessagecolor "All VM Image Publishers`n"
$images = Get-AzureRMVMImagePublisher -Location $location
$images.publishername
Read-Host -prompt "`nPress Enter"
Clear-Host
## Names of VM Images Published for MicrosoftWindowsServer
write-host -foregroundcolor $processmessagecolor "All VM Image Families Published by Publisher`n"
$imageoffer = Get-AzureRMVMImageOffer -Location $location -Publisher $pubName
$imageoffer.Offer
Read-Host -prompt "`nPress Enter"
Clear-Host
## Names of VM Images offered by Image Publisher i.e. WindowsServer
write-host -foregroundcolor $processmessagecolor "All VM Images Offered by Image Publisher`n"
$imagesku=Get-AzureRMVMImageSku -Location $location -Publisher $pubName -Offer $offerName
$imagesku.skus
write-host -foregroundcolor $systemmessagecolor "`nScript finished"