Skip to content

Commit 673006d

Browse files
committed
powershell azurestackhci update
1 parent 7c8e765 commit 673006d

21 files changed

+353
-56
lines changed

src/StackHCIVM/StackHCIVM.Autorest/custom/Az.StackHCIVM.custom.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.StackHCIVM.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.StackHCIVM.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.StackHCIVM.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.StackHCIVM.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMNetworkInterface_ByResourceId.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Gets a network interface
2222
2323
2424
.Outputs
25-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterfaces
25+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterface
2626
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.stackhcivm/get-azstackhcivmnetworkinterface
2929
#>
3030
function Get-AzStackHCIVMNetworkInterface_ByResourceId {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterfaces])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterface])]
3232
[CmdletBinding( PositionalBinding=$false)]
3333
param(
3434

src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMStoragePath_ByResourceId.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Gets a storage path blah
2020
Gets a storage path blah
2121
2222
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainers
23+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainer
2424
2525
.Link
2626
https://learn.microsoft.com/powershell/module/az.stackhcivm/get-azstackhcivmstoragepath
2727
#>
2828
function Get-AzStackHCIVMStoragePath_ByResourceId {
29-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainers])]
29+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainer])]
3030
[CmdletBinding(PositionalBinding=$false)]
3131

3232
param(

src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Gets a virtual hard disk
2020
Gets a virtual hard disk
2121
2222
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualHardDisks
23+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualHardDisk
2424
.Link
2525
https://learn.microsoft.com/powershell/module/az.stackhcivm/get-azstackhcivmvirtualharddisk
2626
#>
2727
function Get-AzStackHCIVMVirtualHardDisk_ByResourceId {
28-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualHardDisks])]
28+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualHardDisk])]
2929
[CmdletBinding( PositionalBinding=$false)]
3030

3131
param(

src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVmImage.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Gets a gallery image
2121
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImages
24+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImage
2525
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalleryImages
2626
2727
.Link
@@ -31,7 +31,7 @@ https://learn.microsoft.com/powershell/module/az.stackhcivm/get-azstackhcivmimag
3131
function Get-AzStackHCIVMImage{
3232
[CmdletBinding(DefaultParameterSetName='BySubscription', PositionalBinding=$false)]
3333
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalleryImages])]
34-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImages])]
34+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImage])]
3535
param(
3636
[Parameter(ParameterSetName='ByName', Mandatory)]
3737
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Path')]

src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVmLogicalNetwork_ByResourceId2.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Gets a logical network
2121
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetworks
24+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetwork
2525
2626
.Link
2727
https://learn.microsoft.com/powershell/module/az.stackhcivm/get-azstackhcivmlogicalnetwork
2828
#>
2929
function Get-AzStackHCIVMLogicalNetwork_ByResourceId {
30-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHciVM.Models.ILogicalNetworks])]
30+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetwork])]
3131
[CmdletBinding(PositionalBinding=$false)]
3232

3333
param(

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PS C:\> {{ Add code here }}
3131
3232
3333
.Outputs
34-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImages
34+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImage
3535
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalleryImages
3636
.Notes
3737
COMPLEX PARAMETER PROPERTIES
@@ -42,7 +42,7 @@ https://learn.microsoft.com/powershell/module/az.stackhcivm/new-azstackhcivmimag
4242
function New-AzStackHCIVMImage{
4343
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalleryImages],ParameterSetName='Marketplace' )]
4444
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalleryImages],ParameterSetName='MarketplaceURN' )]
45-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImages],ParameterSetName='GalleryImage' )]
45+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImage],ParameterSetName='GalleryImage' )]
4646
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4747
param(
4848

@@ -102,9 +102,10 @@ function New-AzStackHCIVMImage{
102102

103103
[Parameter(ParameterSetName='GalleryImage', Mandatory)]
104104
[Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Category('Body')]
105-
[System.String]
106-
# Local path of image that the image should be created from.
105+
[System.Security.SecureString]
106+
# Local path of image that the image should be created from (as SecureString).
107107
# This parameter is required for non marketplace images.
108+
# Use: ConvertTo-SecureString -String "path\to\image.vhdx" -AsPlainText -Force
108109
${ImagePath},
109110

110111
[Parameter(ParameterSetName='GalleryImage', Mandatory)]
@@ -238,7 +239,6 @@ function New-AzStackHCIVMImage{
238239
${ProxyUseDefaultCredentials}
239240

240241
)
241-
242242
if (-Not ($name -match $imageNameRegex )) {
243243
Write-Error "Invalid Name for image provided: $name" -ErrorAction Stop
244244
}
@@ -307,7 +307,6 @@ function New-AzStackHCIVMImage{
307307
$PSBoundParameters['ErrorAction'] = 'Stop'
308308
try {
309309
Az.StackHCIVM.internal\New-AzStackHCIVMMarketplaceGalleryImage @PSBoundParameters
310-
Start-Sleep -Seconds 60
311310
$PercentCompleted = 0
312311
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete:" -PercentComplete $PercentCompleted
313312
$null = $PSBoundParameters.Remove("Version")
@@ -330,15 +329,13 @@ function New-AzStackHCIVMImage{
330329
$PercentCompleted = 0
331330
}
332331
Write-Progress -Activity "Download Percentage: " -Status "$PercentCompleted % Complete" -PercentComplete $PercentCompleted
333-
Start-Sleep -Seconds 5
334332
if ($image.ProvisioningStatus -eq "Failed") {
335333
Break
336334
}
337335
}
338336
if ($image.ProvisioningStatus -eq "Failed"){
339337
Write-Error $image.StatusErrorMessage -ErrorAction Stop
340338
}
341-
342339
} catch {
343340
$e = $_
344341
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
@@ -416,6 +413,7 @@ function New-AzStackHCIVMImage{
416413
if ($PSCmdlet.ParameterSetName -eq "GalleryImage")
417414
{
418415
try{
416+
# ImagePath is already a SecureString, no conversion needed
419417
Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage -ErrorAction Stop @PSBoundParameters
420418
} catch {
421419
$e = $_

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The operation to create or update a logical network.
2222
Please note some properties can be set only during logical network creation.
2323
2424
.Outputs
25-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetworks
25+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetwork
2626
.Notes
2727
COMPLEX PARAMETER PROPERTIES
2828
@@ -50,7 +50,7 @@ https://learn.microsoft.com/powershell/module/az.stackhcivm/new-azstackhcivmlogi
5050
#>
5151

5252
function New-AzStackHCIVMLogicalNetwork {
53-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetworks])]
53+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.ILogicalNetwork])]
5454
[CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
5555
param(
5656
[Parameter(Mandatory)]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The operation to create or update a network interface.
2222
Please note some properties can be set only during network interface creation.
2323
2424
.Outputs
25-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterfaces
25+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterface
2626
.Notes
2727
COMPLEX PARAMETER PROPERTIES
2828
@@ -36,7 +36,7 @@ IPCONFIGURATION <IIPConfiguration[]>: IPConfigurations - A list of IPConfigurati
3636
https://learn.microsoft.com/powershell/module/az.stackhcivm/new-azstackhcivmnetworkinterface
3737
#>
3838
function New-AzStackHCIVMNetworkInterface {
39-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterfaces])]
39+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.INetworkInterface])]
4040
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4141
param(
4242
[Parameter(Mandatory)]

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ The operation to create or update a storage container.
2323
Please note some properties can be set only during storage container creation.
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainers
26+
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainer
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.stackhcivm/new-azstackhcivmstoragepath
2929
#>
3030
function New-AzStackHCIVMStoragePath{
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainers])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IStorageContainer])]
3232
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3333
param(
3434
[Parameter(Mandatory)]
@@ -145,7 +145,6 @@ param(
145145
Write-Error "Invalid CustomLocationId: $CustomLocationId" -ErrorAction Stop
146146
}
147147

148-
149148
try{
150149
Az.StackHCIVM.internal\New-AzStackHCIVMStoragePath -ErrorAction Stop @PSBoundParameters
151150
} catch {
@@ -156,5 +155,5 @@ param(
156155
Write-Error $e.Exception.Message -ErrorAction Stop
157156
}
158157
}
159-
158+
160159
}

0 commit comments

Comments
 (0)