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

Function-level reference for all library modules under src\event\, src\utility\, and src\core\.


src\event\progress.ps1

FunctionDescription
Test-ConsoleInteractiveSafely detects whether stdout is an interactive console (prevents exceptions when output is redirected/piped).
Clear-ProgressLineErases any active inline progress bar before printing a console log line.
Show-WgetProgress -Task -Percent [-Stats] [-ThrottleMs 75] [-Complete]Renders a throttled wget/docker-style inline progress bar with elapsed mm:ss timer.

src\event\logger.ps1

FunctionDescription
Resolve-ProjectRoot [-ScriptRoot]Resolves {ROOT} from argument or two parent levels above src\event\.
Invoke-LogPruning -LogsDir [-RetentionDays 30]Deletes *.log files older than RetentionDays; returns List[string] of pruned filenames (via unary ,).
Initialize-Logger [-ScriptRoot] [-Component] [-RetentionDays] [-LogPrefix] [-Context]Creates logs\, prunes expired logs, opens logs\<prefix>-YYYY-MM-DD.log, and writes a full SESSION START banner.
Get-CurrentLogFilePathReturns the active daily log file path.
Write-Log -Message [-Level]Writes timestamped [file:line] entry to the log file; prints INFO/WARN/ERROR/SUCCESS to console (DEBUG/TRACE are file-only).
Write-ExceptionLog -ErrorRecord [-Context]Logs exception message (ERROR) plus exception type, inner exception, invocation position, and ScriptStackTrace (DEBUG).
Close-Logger [-Status]Writes SESSION END footer with elapsed duration.

src\utility\filesystem.ps1

FunctionDescription
Invoke-FileDownloadWithProgress -Uri -OutFile [-TaskLabel] [-TimeoutMinutes 15]Streams HTTPS downloads via System.Net.Http.HttpClient into a .part temp file, atomically moves to $OutFile, and logs resolved URI, HTTP status, size, speed, and duration.
Expand-ZipWithProgress -ZipPath -DestinationPath [-PreserveData] [-StripSingleTopDir] [-OnlyUnderPrefix] [-TaskLabel]Extracts .zip / .nupkg archives via System.IO.Compression.ZipFile with strict Zip Slip protection, optional data\ preservation, single-root flattening, and prefix extraction.
Remove-FolderWithProgress -FolderPath [-TaskLabel]High-speed .NET [System.IO.Directory]::EnumerateFiles / [System.IO.File]::Delete deletion with read-only attribute clearing and rd /s /q fallback.
Stop-EditorProcessesInDir -InstallDir [-ProcessNames]Stops running editor processes strictly inside $InstallDir\.

src\utility\path.ps1

FunctionDescription
Send-EnvironmentChangeBroadcastBroadcasts WM_SETTINGCHANGE ("Environment") via user32.dll SendMessageTimeout.
Test-UserPathDirectory -DirectoryCase-insensitive, trailing-slash-normalized check for any directory in User PATH.
Add-UserPathDirectory -Directory [-AlsoUpdateProcessPath]Deduplicated User PATH append + optional live $env:Path prepend + broadcast.
Test-UserPathEntry -TargetDirChecks <TargetDir>\bin in User PATH.
Add-UserPathEntry -TargetDirAdds <TargetDir>\bin to User PATH and current process PATH.
Remove-UserPathEntry -TargetDirRemoves exact $TargetDir or $TargetDir\* entries from User PATH.

src\utility\registry.ps1

FunctionDescription
Test-RegistryValueMatchesDir -Value -InstallDirDirectory-boundary-safe regex check preventing sibling path collisions.
Add-ContextMenu -InstallDir [-Profile]Registers 4 Explorer shell context menus (*, Directory, Directory\Background, Drive) under HKCU\Software\Classes via .NET Registry API.
Test-ContextMenu -InstallDir [-Profile]Returns registration count (RegisteredCount/TotalCount, IsComplete, Details).
Find-EditorPathsInRegistryTargeted non-recursive .NET scan across HKCU/HKLM shell keys, Applications, and App Paths.
Remove-ContextMenuAndReg -InstallDirDeletes matched shell keys and MuiCache entries referencing $InstallDir.
Add-ToolAppPathRegistry -ExePath [-ExtraPathDirs]Writes HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\<exe>.
Add-PythonPep514Registry -PythonDir -VersionWrites PEP 514 HKCU\Software\Python\PythonCore\<X.Y> and InstallPath keys.
Set-ProgramSoftwareRegistryKey -SubKey -ValuesWrites values directly under HKCU\Software\<OfficialProgramName>.
Get-ProgramSoftwareRegistryValue -SubKey [-ValueName]Reads a program registry value from HKCU or HKLM.
Find-ToolInAppPathsRegistry -ExeNameResolves an executable from HKCU/HKLM App Paths.

src\core\config.ps1

FunctionDescription
ConvertFrom-IniTypedValue -RawValueParses INI values into PowerShell booleans, longs, doubles, strings, newline escapes, or JSON objects/arrays (ConvertFrom-Json -AsHashtable).
Resolve-ConfigBool -ValueConverts true/1/yes/on → $true, false/0/no/off → $false, blank → $null.
Resolve-IniFilePath -NameOrPath -ScriptRoot [-SearchProfilesDir]Resolves profile names or relative/absolute .ini paths.
Import-EditorIniFile -PathParses [Profile], [Settings], [Extensions], and [Dependencies] from any profile or editor .ini.
Get-ManagerConfig [-ScriptRoot]Parses config.ini and loads only referenced OptionalProfiles and EditorConfigFile.
Write-ConfigDiagnosticLog -ConfigLogs full loaded config, profiles, and counts at DEBUG level.
Get-TargetDir -ProvidedPath -Config [-Profile] [-PromptText]Expands {program_name} and resolves target installation directory.

src\core\edition.ps1

FunctionDescription
Get-EditorProfile -Product -ChannelReturns metadata hashtable for vscode/vscodium × stable/insiders.
Get-AllEditorProfilesReturns all 4 edition profiles.
Select-EditorProfile [-Config] [-CliProduct] [-CliChannel]Resolves or interactively prompts for product & channel.
Resolve-PackageDownloadInfo -ProfileReturns { Url; Tag; AssetName } from Microsoft direct endpoint or GitHub Releases API.
Get-InstalledEditorProfile -InstallDirDetects installed edition from executable filename.
Get-InstalledEditorVersion -InstallDirReads version from package.json, product.json, commit-hash-nested package.json, or PE FileVersionInfo.
Test-PortableMode -InstallDirReturns $true if <InstallDir>\data exists.
Get-EditorCliPath -InstallDir [-Profile]Locates <InstallDir>\bin\<cli>.cmd.
Find-BundledRipgrepPath -InstallDirPrefers standalone rg.exe (PATH, App Paths, HKCU\Software\ripgrep), falling back to @vscode\ripgrep-universal, legacy @vscode\ripgrep, and commit-hash layouts.

src\core\discovery.ps1

FunctionDescription
Find-VSCodeInstalls [-Config] [-IncludeMissing]Auto-discovers portable installations across .NET Registry, User PATH, running processes, and expanded DefaultInstallDir, excluding standard non-portable system/user installers.
Format-InstallBadges -InstallFormats version, portable, context menu, and PATH status badges.
Select-DiscoveredInstall -Discovered [-PromptTitle] [-AllowManualEntry]Interactive installation picker shared by update.ps1, configure.ps1, and uninstall.ps1.

src\core\settings.ps1

FunctionDescription
Get-SettingsSchemaReturns the curated interactive wizard schema across all categories (Portable & Updates, Privacy & Telemetry, AI & Copilot, Performance (Low-End), Editor, Files, Workbench & UI, Terminal, Git).
Get-SettingsPresets [-ScriptRoot]Dynamically loads every profiles\*.ini file via Import-EditorIniFile.
ConvertFrom-Jsonc -RawTextString-literal-safe JSONC comment (//, /* */) and trailing-comma stripper + ConvertFrom-Json -AsHashtable.
Read-EditorSettings -InstallDir / Write-EditorSettings -InstallDir -SettingsReads/writes UTF-8 (no BOM) deterministically sorted data\user-data\User\settings.json with automatic .bak backup.
Merge-SettingsHashtable -Base -Overlay [-OverwriteExisting]Recursive deep merger tracking Added, Updated, and Preserved counts.
Resolve-ConfiguredSettings [-Config] [-PresetName] [-ExtraOverrides] [-ScriptRoot]Layers optional profile INI(s) → EditorConfigFile → inline fallback → runtime overrides; returns { Settings; Extensions; Dependencies; Sources }.
Expand-SettingsTokens -Settings -InstallDirExpands {ripgrep_path}, {install_dir}, and {data_dir} in string values.
Apply-EditorSettings -InstallDir -OverlaySettings [-OverwriteExisting]Expands tokens, merges into existing settings.json, and writes to disk.
Select-OptionalPresetInteractive [-ScriptRoot] / Invoke-InteractiveSettingsWizard -InstallDirInteractive menus used by configure.ps1 and install.ps1.

src\core\dependencies.ps1

FunctionDescription
Get-DependencyCatalogDefinitions for all supported tools (Git, ripgrep, Node.js, Python 3, CMake, Ninja, clangd, Rust, Go, Terraform, ShellCheck, PowerShell 7, Docker).
Get-ExtensionDependencyMapMaps VS Code / VSCodium extension IDs to required tool IDs.
Get-RequiredDependenciesForExtensions [-Extensions] [-ExtraDependencies]Deduplicates required tool IDs with their requesting extension reasons.
Test-DependencyInstalled -ToolId [-Config]Multi-source check (PATH skipping WindowsApps Python stubs, App Paths, official Software\* / PEP 514 registry, DefaultToolsDir).
Resolve-ToolDownloadInfo -ToolQueries official GitHub Releases, nodejs.org, NuGet v3, HashiCorp Checkpoint, go.dev, or rustup-init.
Register-PortableToolEnvironmentAndRegistry -Tool -InstallDir [-Version]Registers User + process PATH, App Paths\<exe>, and official HKCU\Software\<Program> keys.
Install-PortableDependency -ToolId [-Config]Downloads, extracts, bootstraps (ensurepip for Python / portable rustup-init for Rust), and registers a portable tool.
Get-DependencyExecutableSettingsPatch -RequiredMap [-Config]Builds the settings.json executable path patch (todo-tree.ripgrep.ripgrep, git.path, etc.).
Invoke-DependencyCheckAndInstallFull dependency audit, interactive/automatic portable installation, existing portable tool registration repair, legacy key cleanup, and settings.json wiring.