forked from bekimd-ms/AzureStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetimages.ps1
More file actions
21 lines (18 loc) · 787 Bytes
/
getimages.ps1
File metadata and controls
21 lines (18 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Param(
[string]$username,
[string]$password
)
Import-Module .\AzureStack-Tools\ComputeAdmin\AzureStack.ComputeAdmin.psm1
$tenId = (Get-AzureRmSubscription).TenantId
$secret = convertto-securestring -String $password -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secret
$list = Import-Csv "imagelist.csv"
foreach( $item in $list )
{
$image = Get-VMImage -publisher $item.Publisher -offer $item.Offer -sku $item.SKU -version $item.Version -tenantID $tenId -azureStackCredentials $cred -Environment AzureStackAdmin
"Publisher: " + $item.Publisher
"Offer: " + $item.Offer
"Sku: " + $item.Sku
"Version: " + $item.Version
"State: " + $image.properties.provisioningState
}