fix(powershell): handle unavailable Update-Module#1993
Conversation
|
Tested with:
|
|
@atoerien any chance you can review this? |
atoerien
left a comment
There was a problem hiding this comment.
Looks good, tested working on macOS, but I haven't been able to test on Windows yet.
Just have a couple relatively minor comments.
|
Latest push addresses the PowerShell review feedback:
Validated on Linux:
|
|
Latest push addresses the remaining PowerShell review feedback:
Validated locally:
Windows/PowerShell runtime probes:
CI is green on the latest commit ( |
atoerien
left a comment
There was a problem hiding this comment.
Just two final nits, otherwise all good - tested everything seems to be working on Windows with pwsh and powershell (both with a working Update-Module)
|
@atoerien thx for the feedback. |
What does this PR do
Closes #1443.
This changes the PowerShell module update step to avoid passing
-ForcetoUpdate-Modulewhen--yesis used. Instead, it passes-Confirm:$falseand conditionally addsAcceptLicensewhen the installedUpdate-Modulesupports it.It also checks whether
PowerShellGetcan provideUpdate-Modulebefore running the update. IfUpdate-Moduleis unavailable or cannot be loaded, Topgrade now prints a warning and marks the step as skipped instead of failing with a command-not-found error or reportingOKafter doing no update.This helps Windows PowerShell 5.1 setups where
PowerShellGet/PackageManagementare broken, blocked by cloud-backed module folders, or otherwise cannot be autoloaded.Standards checklist
CONTRIBUTING.mdAI involvement
I used AI assistance while investigating the PowerShell behavior, drafting the code change, and running local checks. I reviewed the changes myself before submitting.