-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts Windows PackageManagers
Scripts in Scripts/Windows/PackageManagers/.
What it does: "Late adoption" script — brings software you already installed manually under Chocolatey management without reinstalling.
How it works:
- Requires administrator privileges (exits if not admin).
- Scans
C:\Program Files\andC:\Program Files (x86)\for.exefiles. - For each executable found, queries the Chocolatey repository via
Find-Package -Provider chocolateyfor a matching package. - If any matches are found:
- Installs Chocolatey if missing.
- Pins each matched package (
choco pin add -n=<name>). - Upgrades all matched packages (
choco upgrade <names> -y).
Parameters: None.
Requirements: Administrator privileges. Chocolatey is installed automatically if missing. Internet access required for the package search.
Usage:
.\Scripts\Windows\PackageManagers\Import-ChocolateyPackages.ps1Notes:
-
Find-Package -Provider chocolateyis slower thanchoco search— it queries the API for each exe file found. On a machine with many installed programs this can take several minutes. - Matching is by executable filename, not by product name — a match means a Chocolatey package exists with that exe name, not necessarily the same application. Review the matched list before confirming.
- If Chocolatey is not already installed, the script installs it inline before pinning — this temporarily sets the process execution policy to
Bypass.
What it does: Detects installed Python versions, upgrades to the latest, removes older versions, upgrades pip, and optionally removes virtual environments.
How it works:
- Requires administrator privileges.
- Installs Chocolatey if missing.
- Detects Python versions via
choco list python --local-only(preferred) or via registry (HKLM:\Software\Python\PythonCore). - Sorts by version descending. Identifies the latest version.
- For each older version: runs
choco upgrade <package> -ythenchoco uninstall <package> -y. (If not using Chocolatey, runs the uninstaller directly from the install path.) - Upgrades pip:
python -m pip install --upgrade pip. - Looks for virtual environments in
$env:USERPROFILE\Envs(virtualenvwrapper convention). If found, prompts to delete them.
Parameters: None (interactive prompts for venv deletion).
Requirements: Administrator privileges. Chocolatey recommended; falls back to registry detection.
Usage:
.\Scripts\Windows\PackageManagers\Update-PythonInstallation.ps1Known limitations:
- The Chocolatey path runs both
choco upgradeandchoco uninstallon each old version sequentially. Since upgrade changes the installed version, the subsequent uninstall targets the package by name — this may or may not correctly remove the old version depending on how Chocolatey tracks versioned Python packages. - The venv search path (
$env:USERPROFILE\Envs) is specific to virtualenvwrapper-win. Standardpython -m venvenvironments are not scanned. - If Python is not on the PATH after upgrade, the
pip install --upgrade pipstep will fail silently or target the wrong interpreter.
What it does: An interactive terminal browser for Scoop packages. Shows package info for each available package and lets you install selected ones in the background while you keep browsing.
How it works:
- Checks that Scoop is installed; exits with an error message if not.
- Runs
scoop searchto get the package list. - For each package, clears the screen, shows
scoop info <name>, and prompts for Y/N. - If Y, starts a background job (
Start-Job) to runscoop install <name>. - At the end, lists all running installation jobs and how to retrieve their output.
Parameters: None.
Requirements: Scoop installed. No admin rights required.
Usage:
.\Scripts\Windows\PackageManagers\Invoke-ScoopBrowser.ps1Notes:
-
scoop searchwithout arguments returns all packages in all configured buckets — this can be hundreds or thousands of entries. The browser is designed for exploration, not a quick targeted search. - Background jobs run as separate PowerShell processes. To check progress or see install output:
Get-Job # list all jobs and their state Receive-Job -Id <JobId> # get output from a specific job Wait-Job -Id <JobId> # block until a job finishes
- Jobs created by this script are named
ScoopInstall-<packagename>.