Skip to content

Commit 9d2ca72

Browse files
Use AzsGalleryItem and removed message during Add-VMImage
1 parent c8ae393 commit 9d2ca72

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

ComputeAdmin/AzureStack.ComputeAdmin.psm1

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Add-AzsVMSSGalleryItem {
4242

4343
$uri = $blob.Context.BlobEndPoint + $container.Name + "/" + $blob.Name
4444

45-
Add-AzureRMGalleryItem -GalleryItemUri $uri
45+
Add-AzsGalleryItem -GalleryItemUri $uri
4646
}
4747

4848
Export-ModuleMember -Function 'Add-AzsVMSSGalleryItem'
@@ -55,12 +55,12 @@ function Remove-AzsVMSSGalleryItem {
5555

5656
[CmdletBinding(SupportsShouldProcess = $true)]
5757
param()
58-
$item = Get-AzureRMGalleryItem -Name "microsoft.vmss.1.3.6"
58+
$item = Get-AzsGalleryItem -Name "microsoft.vmss.1.3.6"
5959

6060
if ($item) {
6161

6262
if ($pscmdlet.ShouldProcess("Delete VMSS Gallery Item")) {
63-
$null = $item | Remove-AzureRMGalleryItem
63+
$null = $item | Remove-AzsGalleryItem
6464
$item
6565
}
6666
}
@@ -271,11 +271,9 @@ function Add-AzsVMImage {
271271
ApiVersion = "2015-12-01-preview"
272272
Properties = ConvertFrom-Json $propertyBody
273273
}
274-
275-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to create VM image with $imageDescription ?", "")) {
276-
Write-Verbose "Creating VM Image..."
277-
New-AzureRmResource @params -ErrorAction Stop -Force
278-
}
274+
275+
Write-Verbose "Creating VM Image..."
276+
New-AzureRmResource @params -ErrorAction Stop -Force
279277
}
280278

281279
$platformImage = Get-AzsVMImage -publisher $publisher -offer $offer -sku $sku -version $version -location $location
@@ -303,7 +301,7 @@ function Add-AzsVMImage {
303301
$null = $container| Set-AzureStorageBlobContent -File $GalleryItem.FullName -Blob $galleryItem.Name
304302
$galleryItemURI = '{0}{1}/{2}' -f $storageAccount.PrimaryEndpoints.Blob.AbsoluteUri, $containerName, $galleryItem.Name
305303

306-
Add-AzureRMGalleryItem -GalleryItemUri $galleryItemURI
304+
Add-AzsGalleryItem -GalleryItemUri $galleryItemURI
307305

308306
#cleanup
309307
Remove-Item $GalleryItem
@@ -386,7 +384,7 @@ function Remove-AzsVMImage {
386384

387385
if ($pscmdlet.ShouldProcess("$("Remove Gallery Item: '{0}', offer: '{1}', sku: '{2}'" -f $publisher,$offer,$sku)")) {
388386

389-
Get-AzureRMGalleryItem | Where-Object {$_.Name -contains "$publisher.$name.$version"} | Remove-AzureRMGalleryItem
387+
Get-AzsGalleryItem | Where-Object {$_.Name -contains "$publisher.$name.$version"} | Remove-AzsGalleryItem
390388
}
391389
}
392390
}

0 commit comments

Comments
 (0)