Skip to content
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

Fix for Install-PSResource always reinstall issue #525

Merged
merged 2 commits into from Nov 3, 2021

Conversation

@PaulHigin
Copy link
Collaborator

@PaulHigin PaulHigin commented Oct 29, 2021

PR Summary

This PR fixes the 'always reinstall and restore on fail issue' of Issue #498, and also updates the build version to the next release (beta12). This PR also includes some general code clean up.

PR Context

Install-PSResource was always reinstalling modules even though -Reinstall switch was not selected. This is because the code was not correctly removing 'already installed' packages from the 'toinstall' list.

Also, if a reinstall fails because one of the files is locked (as can happen with loaded .NET binaries) then an error message is emitted and the original resource module files are restored.

Unused variables and parameter arguments were removed.
Some minor code refactoring and method renaming for better clarity.
Added some code regions where they were missing.
Alphabetized using statements per code style guidelines.
Upped module version to 3.0.12 beta.

PR Checklist

@PaulHigin PaulHigin requested review from alerickson and anamnavi Oct 29, 2021
Copy link
Member

@anamnavi anamnavi left a comment

LGTM, left a few questions/comments for my own understanding.

Loading

src/code/Utils.cs Show resolved Hide resolved
Loading
src/code/Utils.cs Show resolved Hide resolved
Loading
doBuild.ps1 Show resolved Hide resolved
Loading
src/code/UpdatePSResource.cs Show resolved Hide resolved
Loading
@PaulHigin PaulHigin merged commit 213380a into PowerShell:master Nov 3, 2021
10 checks passed
Loading
@PaulHigin PaulHigin deleted the issues-1 branch Nov 3, 2021
@anamnavi anamnavi mentioned this pull request Dec 1, 2021
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants