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

(#3255) Rewrite chocolateysetup.psm1 #3256

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Jul 6, 2023

Description Of Changes

  • Rewrote the chocolateysetup.psm1 module we use to install Chocolatey

Motivation and Context

This script has barely been touched in the last decade, in part because it's difficult to follow. Gave it a much needed revision to remove unnecessary clutter, make its code patterns more consistent, and be much more sensible in how it declares and calls commands, so that we can be much more confident that things are working how we expect them to.

This should help make it much easier to make changes to going forward, should we ever need to.

Testing

Tests were performed on Win11, Server 2019, and Server 2008R2

  1. Install from scratch using the install.ps1 script we provide on chocolatey.org, providing the -ChocolateyDownloadUrl to point at the locally-built nupkg.
  • Note: on server 2008r2, I had to manually extract the nupkg and run the chocolateyInstall.ps1 due to Many Issues trying to make that script work on that ancient OS (mostly TLS issues I didn't wanna take the time to sort out).
  1. Delete or move the C:\ProgramData\chocolatey folder, then install v2.0 or v2.1 of Chocolatey CLI, then do a choco upgrade --pre -s localfolder/ with the built nupkg in localfolder

Operating Systems Testing

  • Win11
  • Server 2019
  • Server 2008R2

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #3255

This script has barely been touched in the last decade, in part because
it's difficult to follow. Gave it a much needed revision to remove
unnecessary clutter, make its code patterns more consistent, and be much
more sensible in how it declares and calls commands, so that we can be
much more confident that things are working how we expect them to.

This should help make it much easier to make changes to going forward,
should we ever need to.
@vexx32 vexx32 requested review from AdmiringWorm, corbob and gep13 July 6, 2023 19:35
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.

Rewrite the chocolateysetup.psm1 module
1 participant