Skip to content

Conversation

ankitbaluni123
Copy link
Contributor

…e parameter

  • Added -Expedite parameter to expedite the operation of a replicating server.
  • Updated documentation to include new parameter and usage examples.
  • Modified examples to reflect new project and resource group names.
  • Enhanced output formatting in examples for clarity.
  • Added test case for GetByPrioritiseServer functionality.

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

…e parameter

- Added -Expedite parameter to expedite the operation of a replicating server.
- Updated documentation to include new parameter and usage examples.
- Modified examples to reflect new project and resource group names.
- Enhanced output formatting in examples for clarity.
- Added test case for GetByPrioritiseServer functionality.
@Copilot Copilot AI review requested due to automatic review settings September 8, 2025 07:33
Copy link

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

Copy link
Contributor

Thank you for your contribution @ankitbaluni123! We will review the pull request and get back to you soon.

Copy link
Contributor

@Copilot 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 enhances the Get-AzMigrateServerMigrationStatus cmdlet by adding a new -Expedite parameter that provides detailed resource utilization analysis and optimization recommendations for server migration operations. The update also includes comprehensive documentation updates with new examples and improved output formatting.

  • Added -Expedite parameter with a new parameter set GetByPrioritiseServer for migration optimization analysis
  • Enhanced output formatting to include ESXiHost information and improved table display
  • Updated documentation with new examples demonstrating the expedite functionality

Reviewed Changes

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

Show a summary per file
File Description
src/Migrate/Migrate/help/Get-AzMigrateServerMigrationStatus.md Added documentation for new -Expedite parameter and updated examples with new project/resource group names
src/Migrate/Migrate/ChangeLog.md Added changelog entry for the new -Expedite parameter support
src/Migrate/Migrate.Autorest/test/Get-AzMigrateServerMigrationStatus.Tests.ps1 Added test case for the new GetByPrioritiseServer parameter set
src/Migrate/Migrate.Autorest/custom/Get-AzMigrateServerMigrationStatus.ps1 Core implementation of the -Expedite functionality with resource analysis and recommendations
src/Migrate/Migrate.Autorest/examples/Get-AzMigrateServerMigrationStatus.md Updated examples with new parameter usage and output formatting
src/Migrate/Migrate.Autorest/docs/Get-AzMigrateServerMigrationStatus.md Mirror of help file updates for consistent documentation

Comment on lines +193 to 195
if ($ReplicationMigrationItem.MigrationState -eq "MigrationFailed") {
return "Migration Failed"
}
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The logic flow is incorrect. The function checks for MigrationFailed state but then immediately continues to check for InitialSeedingFailed without returning. This could lead to the wrong state being returned for failed migrations.

Copilot uses AI. Check for mistakes.

Comment on lines +255 to +259
if ($Value -ne $null) {
return "$Value %"
} else {
return "-"
}
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The condition $Value -ne $null will return percentage for zero values, which may not be the intended behavior. Consider checking for both null and zero values if zero should display as '-'.

Copilot uses AI. Check for mistakes.

Comment on lines +309 to +312
if ($Capacity -eq "-" -or $Capacity -eq 0 -or $Capacity -eq $null) {
return "-"
}
if ($Utilization -eq "-" -or $Utilization -eq $null) {
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

Comparing a numeric variable $Capacity to the string '-' will never be true. This comparison should be removed or the parameter type should be clarified.

Suggested change
if ($Capacity -eq "-" -or $Capacity -eq 0 -or $Capacity -eq $null) {
return "-"
}
if ($Utilization -eq "-" -or $Utilization -eq $null) {
if ($Capacity -eq 0 -or $Capacity -eq $null) {
return "-"
}
if ($Utilization -eq $null) {

Copilot uses AI. Check for mistakes.

Comment on lines +730 to +731
$row5["Capacity"] = $diskCapacity ?? "-"
$row5["Utilization for server migrations"] = $diskProcessUtil ?? "-"
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The null-coalescing operator ?? is not available in PowerShell 5.1. Use if ($diskCapacity -ne $null) { $diskCapacity } else { '-' } syntax for compatibility.

Copilot uses AI. Check for mistakes.

Comment on lines +741 to +744
$datastoreName = $ds.datastoreName ?? "-"
$row["Resource"] = "Datastore '$datastoreName' Snapshot Count"
$row["Capacity"] = $ds.totalSnapshotsSupported ?? "-"
$row["Utilization for server migrations"] = $ds.totalSnapshotsCreated ?? "-"
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

Multiple uses of the null-coalescing operator ?? which is not available in PowerShell 5.1. Replace with conditional expressions for compatibility.

Copilot uses AI. Check for mistakes.

@ankitbaluni123
Copy link
Contributor Author

Created new PR based on the additonal suggestion of separate chages requirement.

@ankitbaluni123 ankitbaluni123 deleted the expediteChanges branch September 8, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant