Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Module & Function API Reference

Layer 1 — src\event\

src\event\progress.ps1

  • Test-ConsoleInteractive — Returns $true when stdout is an interactive console.
  • Clear-ProgressLine — Erases any active inline progress bar before printing a log line.
  • Show-WgetProgress -Task <string> -Percent <int> [-Stats <string>] [-ThrottleMs 75] [-Complete] — Renders a throttled inline progress bar with elapsed time.

src\event\logger.ps1

  • Resolve-ProjectRoot [-ScriptRoot <string>] — Resolves {ROOT} two directories above src\event\.
  • Initialize-Logger [-ScriptRoot] [-Component] [-RetentionDays 30] [-LogPrefix] [-Context] — Opens the daily log file, writes session metadata, and prunes expired logs.
  • Write-Log -Message <string> [-Level INFO|WARN|ERROR|SUCCESS|DEBUG|TRACE] — Writes timestamped lines to the log file and prints non-debug levels to stdout.
  • Write-ExceptionLog -ErrorRecord <ErrorRecord> [-Context <string>] — Logs message, exception type, inner exception, position, and stack trace.
  • Close-Logger [-Status <string>] — Appends session end footer with total duration.

Layer 2 — src\utility\

src\utility\filesystem.ps1

  • Invoke-FileDownloadWithProgress -Uri <string> -OutFile <string> [-TaskLabel] [-TimeoutMinutes 15] — Streams downloads via .NET HttpClient to a .part temp file before atomic rename.
  • Get-FileSha256 -FilePath <string> / Test-FileSha256 -FilePath <string> -ExpectedHash <string> — Computes and compares SHA-256 hashes.
  • Expand-ZipWithProgress -ZipPath <string> -DestinationPath <string> [-PreserveData] [-StripSingleTopDir] [-OnlyUnderPrefix] — Extracts .zip archives via .NET ZipFile with Zip Slip boundary guards and optional data\ / python-portable.json preservation.
  • Remove-FolderWithProgress -FolderPath <string> — Deepest-first .NET folder removal with progress.
  • Stop-PythonProcessesInDir -InstallDir <string> — Terminates processes whose executable path starts with $InstallDir\.

src\utility\path.ps1

  • Send-EnvironmentChangeBroadcast — Broadcasts WM_SETTINGCHANGE ("Environment").
  • Test-UserPathDirectory / Add-UserPathDirectory / Remove-UserPathEntry — Boundary-safe User PATH management.
  • Test-PythonPathEntries / Add-PythonPathEntries — Manages <InstallDir> and <InstallDir>\Scripts in User PATH.
  • Set-UserEnvVar / Set-PortablePythonEnvVars / Get-PortablePythonEnvStatus / Remove-PortablePythonEnvVarsForDir — Manages PIP_CONFIG_FILE, PIP_CACHE_DIR, PYTHONUSERBASE, PYTHON_HISTORY, and WORKON_HOME.

src\utility\registry.ps1

  • Test-RegistryValueMatchesDir -Value <string> -InstallDir <string> — Exact directory-boundary regex check.
  • Get-PythonPep514Tag -Version <string> [-Arch x64] [-FreeThreaded] — Formats PEP 514 registry tags (3.15, 3.15t, 3.15-arm64, 3.15-32).
  • Add-PythonRegistry / Test-PythonRegistry — Manages PEP 514 HKCU\Software\Python\PythonCore\<Tag> and App Paths (python.exe, pythonw.exe, pip.exe).
  • Add-PythonContextMenu / Test-PythonContextMenu / Remove-PythonContextMenu — Manages "Open Python Prompt Here" Explorer context menus under HKCU\Software\Classes.
  • Find-PythonPathsInRegistry / Remove-PythonAllRegistry — Targeted .NET registry scanner and boundary-safe cleaner.

Layer 3 — src\core\

src\core\config.ps1

  • Resolve-ConfigBool, Split-ListItems, Resolve-IniFilePath
  • Import-PythonIniFile -Path <string> — Parses [Profile], [PipConfig], [Packages], [Venvs], and [Env].
  • Get-ManagerConfig [-ScriptRoot <string>] — Loads config.ini, explicit OptionalProfiles, and personal PythonConfigFile.
  • Expand-InstallDirTokens / Get-TargetDir — Resolves {program_name}, {channel}, {major}, {minor}, {version}, {arch}.

src\core\release.ps1

  • Get-PythonVersionSortKey -VersionStr <string> — Produces semantic sortable version keys across stable and prerelease (a/b/rc) builds.
  • Get-PythonReleaseIndex [-IncludeOlder] [-ForceRefresh] — Queries https://www.python.org/ftp/python/index-windows.json and follows next pagination.
  • Get-AvailablePythonMinorReleases / Get-AvailablePythonVersionsForMinor
  • Resolve-PythonReleaseSpec / Select-PythonRelease
  • Test-PythonInstallDir / Test-PortableDataMode / Write-PortablePythonMetadata / Get-InstalledPythonInfo

src\core\discovery.ps1

  • Find-PythonInstalls [-Config <hashtable>] [-IncludeMissing] — Multi-source portable Python discovery excluding system/Store/Conda installs and venvs (pyvenv.cfg).
  • Format-InstallBadges / Select-DiscoveredInstall

src\core\settings.ps1

  • Get-PortablePipIniPath / Ensure-PortableDataLayout
  • Expand-PythonSettingTokens / Read-PipIniSettings / Apply-PipIniSettings
  • Get-PythonProfilesCatalog / Resolve-ConfiguredPythonSettings / Select-OptionalProfileInteractive / Invoke-InteractivePipWizard

src\core\packages.ps1

  • Invoke-PortablePythonCommand — Executes python.exe with process environment strictly scoped to <InstallDir>.
  • Ensure-PortablePip — Bootstraps pip offline via ensurepip and optionally upgrades pip.
  • Get-InstalledPipPackages / Install-PipPackagesBatch
  • Get-PortableVenvs / Invoke-VenvSetup / Clear-PortablePipCache