latest powershell changes for azurestackhci#29211
latest powershell changes for azurestackhci#29211shraddhasun wants to merge 9 commits intoAzure:mainfrom
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Az.StackHCIVM AutoRest custom PowerShell cmdlets to align with newer model type names (singular interfaces), introduces additional VM lifecycle operations, and tweaks some cmdlet behavior/documentation.
Changes:
- Update many cmdlets’
.Outputs/[OutputType]declarations from plural to singular model interfaces. - Add new custom cmdlets for VM instance operations (
Save-*,Suspend-*) and adjustStart-*implementation details. - Modify
New-AzStackHCIVMImageandNew-AzStackHCIVMVirtualMachineparameter handling/typing and adjust some custom docs/validation strings.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/StackHCIVM/StackHCIVM.Autorest/custom/utilities/VirtualNetworkValidations.ps1 | Updates validation error strings for virtual network-related objects. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMStoragePath_ByResourceId.ps1 | Adjusts declared output interface to singular form and updates comment-based help output type. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMNetworkInterface_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMLogicalNetwork_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMImage.ps1 | Adjusts declared output interfaces to singular forms per parameter set. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1 | Adds a new custom VM “suspend” cmdlet wrapper around internal implementation. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Start-AzStackHCIVMVirtualMachine_New.ps1 | Refines resource-id parsing / variable usage in the start cmdlet wrapper. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1 | Adds a new custom VM “save” cmdlet wrapper around internal implementation. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/README.md | Normalizes documentation paths to use ../ style separators. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1 | Changes AdminPassword type and updates bound-parameter handling for VM creation. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualHardDisk_New.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMStoragePath_New.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMNetworkInterface_New.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMLogicalNetwork_New.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1 | Adjusts declared output interfaces, changes ImagePath typing, and skips sleeps during playback. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVmLogicalNetwork_ByResourceId2.ps1 | Fixes output interface naming for resource-id based get wrapper. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVmImage.ps1 | Adjusts declared output interfaces to singular forms. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMStoragePath_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
| src/StackHCIVM/StackHCIVM.Autorest/custom/Get-AzStackHCIVMNetworkInterface_ByResourceId.ps1 | Adjusts declared output interface to singular form. |
Comments suppressed due to low confidence (4)
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1:159
- Typo in comment: "provsioned" should be "provisioned".
# Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine creation process. VM Agent is provsioned by default. Please pass -ProvisionVMAgent:$false to disable.
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1:122
- Typo in parameter description: "marketplae" should be "marketplace".
# The name of the marketplae gallery image definition offer.
src/StackHCIVM/StackHCIVM.Autorest/custom/utilities/VirtualNetworkValidations.ps1:26
- The error message has a typo: "Accpeted" should be "Accepted".
Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'Start', 'End', and 'Type'." -ErrorAction Stop
src/StackHCIVM/StackHCIVM.Autorest/custom/utilities/VirtualNetworkValidations.ps1:57
- The error message has a typo: "Accpeted" should be "Accepted".
Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMStoragePath_ByResourceId.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (6)
src/StackHCIVM/StackHCIVM.Autorest/custom/utilities/VirtualNetworkValidations.ps1:57
- Spelling error in error message: "Accpeted" should be "Accepted".
Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1:159
- Spelling error in comment: "provsioned" should be "provisioned".
# Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine creation process. VM Agent is provsioned by default. Please pass -ProvisionVMAgent:$false to disable.
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1:141
- The error message references module name "Az.StackHCIVm" (lowercase
m), which is inconsistent with the actual module nameAz.StackHCIVM. Fixing this avoids confusing guidance for users when handling this exception.
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
src/StackHCIVM/StackHCIVM.Autorest/custom/utilities/VirtualNetworkValidations.ps1:26
- Spelling error in error message: "Accpeted" should be "Accepted".
Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'Start', 'End', and 'Type'." -ErrorAction Stop
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1:122
- Spelling error in parameter comment: "marketplae" should be "marketplace".
# The name of the marketplae gallery image definition offer.
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1:141
- The error message references module name "Az.StackHCIVm" (lowercase
m), which is inconsistent with the actual module nameAz.StackHCIVM. Fixing this avoids confusing guidance for users when handling this exception.
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
|
|
||
| } else { | ||
| Write-Error "Invalid Key specified in IpPool object. Accepted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop | ||
| Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop |
There was a problem hiding this comment.
The error message is misleading in Confirm-Routes: it says "IpPool object" but this branch validates Route keys. Update the message to reference the Route object so callers can diagnose the issue correctly.
| Write-Error "Invalid Key specified in IpPool object. Accpeted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop | |
| Write-Error "Invalid Key specified in Route object. Accepted values are 'AddressPrefix', 'Name', and 'NextHopIPAddress'." -ErrorAction Stop |
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
e31ead6 to
673006d
Compare
src/StackHCIVM/StackHCIVM.Autorest/custom/Update-AzStackHCIVMVirtualHardDisk_ByResourceId.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
673006d to
dbf2837
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (2)
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1:142
- The error message references
Az.StackHCIVm(lowercasem), but the module name isAz.StackHCIVM. Update the message to use the correct module name so users can follow the instruction accurately.
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
} else {
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1:142
- The error message references
Az.StackHCIVm(lowercasem), but the module name isAz.StackHCIVM. Update the message to use the correct module name so users can follow the instruction accurately.
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
} else {
src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1
Show resolved
Hide resolved
| function Save-AzStackHCIVMVirtualMachine { | ||
| [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualMachineInstance])] | ||
| [CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] |
There was a problem hiding this comment.
This PR adds/changes cmdlet surface area (new Save/Suspend cmdlets and parameter type changes). The module ChangeLog (src/StackHCIVM/StackHCIVM/ChangeLog.md) currently has an empty "Upcoming Release" section—please add an entry describing these changes (past tense) and regenerate markdown help so published docs reflect the new cmdlets/parameters.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/StackHCIVM/StackHCIVM.Autorest/test/Save-AzStackHCIVMVirtualMachine.Tests.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/test/Save-AzStackHCIVMVirtualMachine.Tests.ps1
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/StackHCIVM/StackHCIVM.Autorest/test/Save-AzStackHCIVMVirtualMachine.Tests.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/test/Suspend-AzStackHCIVMVirtualMachine.Tests.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/test/Suspend-AzStackHCIVMVirtualMachine.Tests.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/test/Save-AzStackHCIVMVirtualMachine.Tests.ps1
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell |
src/StackHCIVM/StackHCIVM.Autorest/test/AzStackHCIVMImageNew.Tests.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/test/Suspend-AzStackHCIVMVirtualMachine.Tests.ps1
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Suspend-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
src/StackHCIVM/StackHCIVM.Autorest/custom/Save-AzStackHCIVMVirtualMachine_New.ps1
Outdated
Show resolved
Hide resolved
…ests.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…VirtualMachine_New.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell |
…tualMachine_New.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.