-
Notifications
You must be signed in to change notification settings - Fork 46
Update uninstall commands for Az.Accounts #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 -allversionswith 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 } |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md
Show resolved
Hide resolved
TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md
Outdated
Show resolved
Hide resolved
TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md
Outdated
Show resolved
Hide resolved
TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md
Outdated
Show resolved
Hide resolved
|
@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. |
|
@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. |
…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
No description provided.