Skip to content

Conversation

@erskinejohn
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings November 12, 2025 18:59
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 improves the Az.Accounts module version management instructions by replacing a simple uninstall command with a more sophisticated script that selectively removes unwanted versions while preserving or installing the required version (4.0.2).

Key Changes:

  • Replaced simple Uninstall-Module az.accounts -allversions with a multi-step PowerShell script
  • Added logic to uninstall only non-required versions of Az.Accounts
  • Included verification steps to list installed versions before and after the operation

Get-InstalledModule -Name $RequiredModuleName -AllVersions
#Uninstall all but the required version
Get-InstalledModule -Name $RequiredModuleName -AllVersions | Where-Object { $_.Version -ne $RequiredModuleVersion } | ForEach-Object { Uninstall-Module -Name $RequiredModuleName -RequiredVersion $_.Version -Force }
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The -Force parameter on Uninstall-Module is potentially unsafe for production environments as it suppresses all prompts and warnings. Consider removing -Force to allow users to review what will be uninstalled, or add defensive checks before uninstalling (e.g., verify which versions will be removed). Additionally, this complex one-liner lacks error handling - consider using $ErrorActionPreference = "Stop" at the beginning of the script or adding try-catch blocks to handle potential failures gracefully.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Nov 24, 2025

@erskinejohn I've opened a new pull request, #216, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 24, 2025

@erskinejohn I've opened a new pull request, #217, to work on those changes. Once the pull request is ready, I'll request review from you.

erskinejohn and others added 5 commits November 24, 2025 07:00
…ess-To-Subscription.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ess-To-Subscription.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ess-To-Subscription.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
[WIP] Update uninstall commands based on feedback for Az.Accounts
[WIP] WIP address feedback on uninstall commands for Az.Accounts update
@AlBurns-MSFT AlBurns-MSFT merged commit b55f61b into main Nov 24, 2025
1 check passed
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.

3 participants