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

(#310, #3318) Add Uninstall-ChocolateyPath cmdlet & rewrite associated functions as cmdlets #3440

Merged
merged 3 commits into from
May 24, 2024

Commits on May 24, 2024

  1. (chocolatey#310) Add Uninstall-ChocolateyPath as cmdlet

    Finally added Uninstall-ChocolateyPath. However, given overall contribution rates to the powershell functions are quite low, the decision has been made to rewrite our helper functions into C# cmdlets.
    
    This serves as the initial set of cmdlets, a handful of useful example cases to prove out the viability of this approach, as well as ensuring that we have a better path forward for both OSS commands and any licensed commands we want to use in the future. It also opens up the possibility of more easily overriding the OSS cmdlets with a licensed command, and there are provisions in the `chocolateyInstaller.psm1` module script to ensure that can work seamlessly.
    
    Summary of changes:
    
    - Added Uninstall-ChocolateyPath helper cmdlet
    - Rewrote the following associated functions into C# cmdlets:
      - Get-EnvironmentVariable
      - Get-EnvironmentVariableNames
      - Install-ChocolateyPath
      - Set-EnvironmentVariable
      - Test-ProcessAdminRights
      - Update-SessionEnvironment
    - Tweaked the PowerShell command lookup behaviour when loading the `chocolateyInstaller.psm1` module to ensure that licensed cmdlets can be preferentially used instead of open-source cmdlets or functions, regardless of any name collisions that may occur.
    - Tweaked the assembly resolver to ensure that if we have the licensed extension depend on the new Chocolatey.PowerShell assembly, it will not cause any issues when trying to load the licensed extension outside the PowerShell module context.
    vexx32 authored and gep13 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    dc409a3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bbe633d View commit details
    Browse the repository at this point in the history
  3. (chocolatey#310) Add cmdlet docgeneration script

    - Added an `update-cmdlet-documentation.ps1` script which will use PlatyPS to read the cmdlet metadata and keep documentation up to date.
      - Provides a `-NewCommand` switch to allow easier additions of documentation pages for any new cmdlets (PlatyPS does not add newly added commands by default).
      - This script directly adds or updates documentation in a local copy of the chocolatey/docs repository, and compiles an XML help file from the resulting content.
    vexx32 authored and gep13 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    a91901f View commit details
    Browse the repository at this point in the history