Skip to content

Commit beda78b

Browse files
Move StackHCIVM to release-2024-03-05 (#24267)
1 parent c6e9335 commit beda78b

File tree

154 files changed

+5706
-7561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+5706
-7561
lines changed

src/StackHCIVM/StackHCIVM.Autorest/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the StackHcivm service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,47 @@ function New-AzStackHCIVMImage{
303303

304304
if ($PSCmdlet.ParameterSetName -eq "Marketplace")
305305
{
306-
return Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
306+
$PSBoundParameters['NoWait'] = $true
307+
$PSBoundParameters['ErrorAction'] = 'Stop'
308+
try {
309+
Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
310+
Start-Sleep -Seconds 60
311+
$PercentCompleted = 0
312+
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete:" -PercentComplete $PercentCompleted
313+
$null = $PSBoundParameters.Remove("Version")
314+
$null = $PSBoundParameters.Remove("URN")
315+
$null = $PSBoundParameters.Remove("Tag")
316+
$null = $PSBoundParameters.Remove("StoragePathId")
317+
$null = $PSBoundParameters.Remove("Sku")
318+
$null = $PSBoundParameters.Remove("Publisher")
319+
$null = $PSBoundParameters.Remove("Offer")
320+
$null = $PSBoundParameters.Remove("OSType")
321+
$null = $PSBoundParameters.Remove("ImagePath")
322+
$null = $PSBoundParameters.Remove("CustomLocationId")
323+
$null = $PSBoundParameters.Remove("CloudInitDataSource")
324+
$null = $PSBoundParameters.Remove("Location")
325+
$null = $PSBoundParameters.Remove("NoWait")
326+
while ($PercentCompleted -ne 100 ) {
327+
$image = Az.StackHCIVM.internal\Get-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
328+
$PercentCompleted = $image.StatusProgressPercentage
329+
if ($PercentCompleted -eq $null){
330+
$PercentCompleted = 0
331+
}
332+
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete" -PercentComplete $PercentCompleted
333+
Start-Sleep -Seconds 5
334+
if ($image.ProvisioningStatus -eq "Failed") {
335+
Break
336+
}
337+
}
338+
if ($image.ProvisioningStatus -eq "Failed"){
339+
Write-Error $image.StatusErrorMessage -ErrorAction Stop
340+
}
341+
342+
} catch {
343+
Write-Error $_.Exception.Message -ErrorAction Stop
344+
}
307345

346+
308347
} elseif ($PSCmdlet.ParameterSetName -eq "MarketplaceURN") {
309348
if ($URN -match $urnRegex){
310349
$publisher = $Matches.publisher.ToLower()
@@ -320,15 +359,54 @@ function New-AzStackHCIVMImage{
320359
} else {
321360
Write-Error "Invalid URN provided: $URN. Valid URN format is Publisher:Offer:Sku:Version ." -ErrorAction Stop
322361
}
362+
363+
$PSBoundParameters['NoWait'] = $true
364+
$PSBoundParameters['ErrorAction'] = 'Stop'
365+
try {
366+
Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
367+
Start-Sleep -Seconds 60
368+
$PercentCompleted = 0
369+
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete:" -PercentComplete $PercentCompleted
370+
$null = $PSBoundParameters.Remove("Version")
371+
$null = $PSBoundParameters.Remove("URN")
372+
$null = $PSBoundParameters.Remove("Tag")
373+
$null = $PSBoundParameters.Remove("StoragePathId")
374+
$null = $PSBoundParameters.Remove("Sku")
375+
$null = $PSBoundParameters.Remove("Publisher")
376+
$null = $PSBoundParameters.Remove("Offer")
377+
$null = $PSBoundParameters.Remove("OSType")
378+
$null = $PSBoundParameters.Remove("ImagePath")
379+
$null = $PSBoundParameters.Remove("CustomLocationId")
380+
$null = $PSBoundParameters.Remove("CloudInitDataSource")
381+
$null = $PSBoundParameters.Remove("Location")
382+
$null = $PSBoundParameters.Remove("NoWait")
383+
while ($PercentCompleted -ne 100 ) {
384+
$image = Az.StackHCIVM.internal\Get-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
385+
$PercentCompleted = $image.StatusProgressPercentage
386+
if ($PercentCompleted -eq $null){
387+
$PercentCompleted = 0
388+
}
389+
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete" -PercentComplete $PercentCompleted
390+
Start-Sleep -Seconds 5
391+
if ($image.ProvisioningStatus -eq "Failed") {
392+
Break
393+
}
394+
}
395+
if ($image.ProvisioningStatus -eq "Failed"){
396+
Write-Error $image.StatusErrorMessage -ErrorAction Stop
397+
}
398+
399+
} catch {
400+
Write-Error $_.Exception.Message -ErrorAction Stop
401+
}
323402

324-
return Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
325403

326404
}
327405

328406
if ($PSCmdlet.ParameterSetName -eq "GalleryImage")
329407
{
330408

331-
return Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage @PSBoundParameters
409+
Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage @PSBoundParameters
332410
}
333411

334412

src/StackHCIVM/StackHCIVM.Autorest/exports/Add-AzStackHCIVMVirtualMachineDataDisk.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ param(
8383
[Parameter(DontShow)]
8484
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
8585
[System.Management.Automation.SwitchParameter]
86-
# Wait for .NET debugger to attach
86+
# Wait forNET debugger to attach
8787
${Break},
8888

8989
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Add-AzStackHCIVMVirtualMachineNetworkInterface.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ param(
8383
[Parameter(DontShow)]
8484
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
8585
[System.Management.Automation.SwitchParameter]
86-
# Wait for .NET debugger to attach
86+
# Wait forNET debugger to attach
8787
${Break},
8888

8989
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMImage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ param(
7373
[Parameter(DontShow)]
7474
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7575
[System.Management.Automation.SwitchParameter]
76-
# Wait for .NET debugger to attach
76+
# Wait forNET debugger to attach
7777
${Break},
7878

7979
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMLogicalNetwork.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ param(
7575
[Parameter(DontShow)]
7676
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7777
[System.Management.Automation.SwitchParameter]
78-
# Wait for .NET debugger to attach
78+
# Wait forNET debugger to attach
7979
${Break},
8080

8181
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMNetworkInterface.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ param(
7575
[Parameter(DontShow)]
7676
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7777
[System.Management.Automation.SwitchParameter]
78-
# Wait for .NET debugger to attach
78+
# Wait forNET debugger to attach
7979
${Break},
8080

8181
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMStoragePath.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ param(
7575
[Parameter(DontShow)]
7676
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7777
[System.Management.Automation.SwitchParameter]
78-
# Wait for .NET debugger to attach
78+
# Wait forNET debugger to attach
7979
${Break},
8080

8181
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMVirtualHardDisk.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ param(
7575
[Parameter(DontShow)]
7676
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7777
[System.Management.Automation.SwitchParameter]
78-
# Wait for .NET debugger to attach
78+
# Wait forNET debugger to attach
7979
${Break},
8080

8181
[Parameter(DontShow)]

src/StackHCIVM/StackHCIVM.Autorest/exports/Get-AzStackHCIVMVirtualMachine.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ param(
7676
[Parameter(DontShow)]
7777
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
7878
[System.Management.Automation.SwitchParameter]
79-
# Wait for .NET debugger to attach
79+
# Wait forNET debugger to attach
8080
${Break},
8181

8282
[Parameter(DontShow)]

0 commit comments

Comments
 (0)