Skip to content

latest powershell changes for azurestackhci#29211

Open
shraddhasun wants to merge 9 commits intoAzure:mainfrom
shraddhasun:users/shraddha/powershell
Open

latest powershell changes for azurestackhci#29211
shraddhasun wants to merge 9 commits intoAzure:mainfrom
shraddhasun:users/shraddha/powershell

Conversation

@shraddhasun
Copy link
Member

@shraddhasun shraddhasun commented Feb 27, 2026

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings February 27, 2026 01:13
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 adjust Start-* implementation details.
  • Modify New-AzStackHCIVMImage and New-AzStackHCIVMVirtualMachine parameter 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

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings February 27, 2026 22:34
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 name Az.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 name Az.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
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings February 27, 2026 23:10
@shraddhasun shraddhasun force-pushed the users/shraddha/powershell branch from e31ead6 to 673006d Compare February 27, 2026 23:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@shraddhasun shraddhasun force-pushed the users/shraddha/powershell branch from 673006d to dbf2837 Compare February 28, 2026 00:04
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings February 28, 2026 00:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (lowercase m), but the module name is Az.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 (lowercase m), but the module name is Az.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 {

Comment on lines +31 to +33
function Save-AzStackHCIVMVirtualMachine {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IVirtualMachineInstance])]
[CmdletBinding( PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@shraddhasun
Copy link
Member Author

/azp run

@azure-pipelines
Copy link
Contributor

Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell

@NoriZC
Copy link
Collaborator

NoriZC commented Mar 2, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@NoriZC NoriZC self-assigned this Mar 2, 2026
Copilot AI review requested due to automatic review settings March 2, 2026 19:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 2, 2026 20:03
@isra-fel
Copy link
Member

isra-fel commented Mar 2, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

@isra-fel
Copy link
Member

isra-fel commented Mar 2, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 2, 2026 23:57
@shraddhasun
Copy link
Member Author

/azp run

@azure-pipelines
Copy link
Contributor

Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

…ests.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 3, 2026 00:04
…VirtualMachine_New.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@shraddhasun
Copy link
Member Author

/azp run

@azure-pipelines
Copy link
Contributor

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>
@shraddhasun
Copy link
Member Author

/azp run

@azure-pipelines
Copy link
Contributor

Commenter does not have sufficient privileges for PR 29211 in repo Azure/azure-powershell

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

@notyashhh
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants