Skip to content

Instantly share code, notes, and snippets.

@rgl
Created January 27, 2021 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgl/b07f3bff8a2234de7c3699ea24ea10fb to your computer and use it in GitHub Desktop.
Save rgl/b07f3bff8a2234de7c3699ea24ea10fb to your computer and use it in GitHub Desktop.
show all the chocolatey packages installation parameters / arguments
# see https://github.com/chocolatey/choco/issues/1310
Add-Type -AssemblyName System.Security
Get-ChildItem `
    -Path "$env:ChocolateyInstall\.chocolatey" `
    -Filter .arguments `
    -Recurse `
    | ForEach-Object {
        $name = $_.Directory.BaseName
        $data = [System.Text.Encoding]::UTF8.GetString(
                    [System.Security.Cryptography.ProtectedData]::Unprotect(
                        [System.Convert]::FromBase64String((Get-Content -Encoding UTF8 $_.FullName)),
                        [System.Text.Encoding]::UTF8.GetBytes("Chocolatey"),
                        [System.Security.Cryptography.DataProtectionScope]::LocalMachine))
        Write-Output "$name $data" 
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment