Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/StackHCIVM/StackHCIVM.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the StackHcivm service.

---

## Info
- Modifiable: yes
- Generated: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,47 @@ function New-AzStackHCIVMImage{

if ($PSCmdlet.ParameterSetName -eq "Marketplace")
{
return Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
$PSBoundParameters['NoWait'] = $true
$PSBoundParameters['ErrorAction'] = 'Stop'
try {
Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
Start-Sleep -Seconds 60
$PercentCompleted = 0
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete:" -PercentComplete $PercentCompleted
$null = $PSBoundParameters.Remove("Version")
$null = $PSBoundParameters.Remove("URN")
$null = $PSBoundParameters.Remove("Tag")
$null = $PSBoundParameters.Remove("StoragePathId")
$null = $PSBoundParameters.Remove("Sku")
$null = $PSBoundParameters.Remove("Publisher")
$null = $PSBoundParameters.Remove("Offer")
$null = $PSBoundParameters.Remove("OSType")
$null = $PSBoundParameters.Remove("ImagePath")
$null = $PSBoundParameters.Remove("CustomLocationId")
$null = $PSBoundParameters.Remove("CloudInitDataSource")
$null = $PSBoundParameters.Remove("Location")
$null = $PSBoundParameters.Remove("NoWait")
while ($PercentCompleted -ne 100 ) {
$image = Az.StackHCIVM.internal\Get-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
$PercentCompleted = $image.StatusProgressPercentage
if ($PercentCompleted -eq $null){
$PercentCompleted = 0
}
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete" -PercentComplete $PercentCompleted
Start-Sleep -Seconds 5
if ($image.ProvisioningStatus -eq "Failed") {
Break
}
}
if ($image.ProvisioningStatus -eq "Failed"){
Write-Error $image.StatusErrorMessage -ErrorAction Stop
}

} catch {
Write-Error $_.Exception.Message -ErrorAction Stop
}


} elseif ($PSCmdlet.ParameterSetName -eq "MarketplaceURN") {
if ($URN -match $urnRegex){
$publisher = $Matches.publisher.ToLower()
Expand All @@ -320,15 +359,54 @@ function New-AzStackHCIVMImage{
} else {
Write-Error "Invalid URN provided: $URN. Valid URN format is Publisher:Offer:Sku:Version ." -ErrorAction Stop
}

$PSBoundParameters['NoWait'] = $true
$PSBoundParameters['ErrorAction'] = 'Stop'
try {
Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
Start-Sleep -Seconds 60
$PercentCompleted = 0
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete:" -PercentComplete $PercentCompleted
$null = $PSBoundParameters.Remove("Version")
$null = $PSBoundParameters.Remove("URN")
$null = $PSBoundParameters.Remove("Tag")
$null = $PSBoundParameters.Remove("StoragePathId")
$null = $PSBoundParameters.Remove("Sku")
$null = $PSBoundParameters.Remove("Publisher")
$null = $PSBoundParameters.Remove("Offer")
$null = $PSBoundParameters.Remove("OSType")
$null = $PSBoundParameters.Remove("ImagePath")
$null = $PSBoundParameters.Remove("CustomLocationId")
$null = $PSBoundParameters.Remove("CloudInitDataSource")
$null = $PSBoundParameters.Remove("Location")
$null = $PSBoundParameters.Remove("NoWait")
while ($PercentCompleted -ne 100 ) {
$image = Az.StackHCIVM.internal\Get-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
$PercentCompleted = $image.StatusProgressPercentage
if ($PercentCompleted -eq $null){
$PercentCompleted = 0
}
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete" -PercentComplete $PercentCompleted
Start-Sleep -Seconds 5
if ($image.ProvisioningStatus -eq "Failed") {
Break
}
}
if ($image.ProvisioningStatus -eq "Failed"){
Write-Error $image.StatusErrorMessage -ErrorAction Stop
}

} catch {
Write-Error $_.Exception.Message -ErrorAction Stop
}

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

}

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

return Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage @PSBoundParameters
Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage @PSBoundParameters
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ param(
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')]
[System.String[]]
# Data Disks - List of data disks to be attached to the virtual machine in name format .
# Data Disks - List of data disks to be attached to the virtual machine in name format
${DataDiskName},

[Parameter()]
Expand Down Expand Up @@ -308,7 +308,7 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
# Wait forNET debugger to attach
${Break},

[Parameter(DontShow)]
Expand Down
Loading