This repository contains a PowerShell workflow for capturing a Windows software inventory, converting it into a structured catalog, enriching that catalog with installer metadata, and preparing a reinstall plan.
It is intended for scenarios such as:
- rebuilding a workstation after a clean install
- documenting the applications on a machine before migration or replacement
- tracking which apps can be restored automatically and which still require manual download steps
- backing up a few app-specific settings folders before reinstalling Windows
The workflow centers on catalog/apps.json, a machine-readable catalog that keeps installation state, package candidates, local installer matches, classification data, and manual follow-up notes in one place. That working file is intentionally ignored by Git so local catalog state does not end up in the public repository.
The repository also includes a small Pester test suite for catalog validation and install-plan generation behavior.
The scripts in this repository help you:
- create an import-ready
installed-programs.csvfrom an existing Windows machine - back up a small set of app-specific settings folders before a rebuild
- export the currently installed Windows programs to CSV
- initialize a JSON catalog from that snapshot
- re-scan the machine and mark apps as installed, missing, or ignored
- classify entries so runtimes and system components can be separated from user applications
- look up likely
wingetpackage IDs and latest available versions - discover matching installer files in local folders
- stage installers into a single working directory
- generate a manual-source queue for apps that cannot be resolved automatically
- build an install plan and optionally execute it
- Windows
- PowerShell 7 or Windows PowerShell with script execution enabled for local scripts
wingetfor package lookup, version refresh, and optional download/install flows- Pester 5 or newer to run the test suite as written
Run commands from the repository root:
pwsh -File .\scripts\AppReinstall.ps1 -Action Doctor| Path | Purpose |
|---|---|
scripts/ |
Entry-point scripts for inventory, catalog maintenance, staging, and installation |
scripts/lib/AppCatalog.psm1 |
Shared helper functions used by all scripts |
catalog/ |
Local working catalog directory; apps.json is ignored by Git |
docs/ |
Supporting project notes and evaluation documents |
installed-programs.csv |
Generic sample source snapshot; replace this with a real export before use |
output/ |
Generated reports, queues, logs, and staged installers |
tests/ |
Pester tests covering catalog validation and install-plan behavior |
output/ is ignored by Git except for a placeholder, and catalog/apps.json is also ignored, so generated reports and local catalog state do not need to be committed.
The recommended path now uses a single workflow wrapper instead of requiring the script-by-script sequence.
pwsh -File .\scripts\AppReinstall.ps1 -Action CaptureThis writes installed-programs.csv in the repository root.
If you want a timestamped backup pack instead, including the app inventory and reference exports:
pwsh -File .\scripts\AppReinstall.ps1 -Action Capture -CaptureMode BackupPackTo include the small settings-backup allowlist in the same capture run:
pwsh -File .\scripts\AppReinstall.ps1 -Action Capture -CaptureMode BackupPack -IncludeSettingsBackuppwsh -File .\scripts\AppReinstall.ps1 -Action DoctorThis validates the Windows host, PowerShell runtime, winget, and the expected working files. A machine-readable report is written to output/preflight-report.json.
To validate the current catalog and install queue structure without changing state:
pwsh -File .\scripts\AppReinstall.ps1 -Action ValidateThis writes output/validation-report.json.
pwsh -File .\scripts\AppReinstall.ps1 -Action PrepareThis runs the current recommended preparation pipeline:
- initialize the catalog if it does not exist yet
- sync the catalog against the current machine
- classify apps and apply ignore recommendations
- resolve
wingetpackage IDs and latest versions - search common folders for installers
- stage installers into
staged-installers/ - build
output/install-queue.json - refresh
output/manual-source-queue.json
Additional reports are also written during prepare, including output/sync-report.json, output/classification-report.json, output/winget-report.json, output/latest-version-report.json, and output/installer-report.json.
To skip winget downloads during staging:
pwsh -File .\scripts\AppReinstall.ps1 -Action Prepare -SkipWingetDownloadTo add manual-reference downloads when a trusted manual URL is already recorded in the catalog:
pwsh -File .\scripts\AppReinstall.ps1 -Action Prepare -DownloadFromManualReferencesTo search additional installer folders during discovery:
pwsh -File .\scripts\AppReinstall.ps1 -Action Prepare -SearchRoot C:\Installers,$env:USERPROFILE\Downloadspwsh -File .\scripts\AppReinstall.ps1 -Action PlanThis writes the current plan to output/install-plan.json without executing anything.
To prefer direct winget install commands in the plan for apps that already have a wingetId:
pwsh -File .\scripts\AppReinstall.ps1 -Action Plan -UseWingetWhenAvailableTo allow .exe installers without recorded silent arguments:
pwsh -File .\scripts\AppReinstall.ps1 -Action Plan -AllowExeWithoutArgspwsh -File .\scripts\AppReinstall.ps1 -Action ExecuteTo review a checklist first and deselect apps you do not want to process:
pwsh -File .\scripts\AppReinstall.ps1 -Action Execute -InteractiveChecklist-UseWingetWhenAvailable and -AllowExeWithoutArgs are also available during -Action Execute.
Checklist controls:
- Up/Down arrows: move cursor
- Space: tick/untick highlighted app
A: select allN: select noneDor Enter: doneCor Esc: cancel
AppReinstall.ps1 exposes the full action set below:
Doctorvalidates the Windows host, PowerShell runtime,winget, key paths, and queue/catalog healthValidatechecks the current catalog and install queue JSON structure without changing workflow stateCaptureexportsinstalled-programs.csvor builds a timestamped backup packInitializecreatescatalog/apps.jsondirectly frominstalled-programs.csvStatusre-syncs the catalog and writesoutput/sync-report.jsonPrepareruns the recommended end-to-end preparation pipelinePlanbuildsoutput/install-plan.jsonExecuteruns the prepared queue and writesoutput/install-log.json
pwsh -File .\scripts\backup-app-list.ps1
pwsh -File .\scripts\backup-app-settings.ps1backup-app-list.ps1 creates an import-ready installed-programs.csv inside a timestamped backup folder, along with supporting reference files such as startup items, shortcuts, taskbar pins, and a reinstall checklist.
Replace the sample installed-programs.csv in this repository with the one generated by backup-app-list.ps1.
If you are running everything on the same machine and only need the app list, you can also generate the CSV directly:
pwsh -File .\scripts\Get-InstalledPrograms.ps1 -Format Csv -OutputPath .\installed-programs.csvpwsh -File .\scripts\Initialize-AppCatalog.ps1This creates catalog/apps.json from the CSV snapshot.
pwsh -File .\scripts\Sync-AppCatalog.ps1 -View Summary
pwsh -File .\scripts\Sync-AppCatalog.ps1 -View Missingpwsh -File .\scripts\Classify-AppCatalog.ps1 -ApplyIgnoreRecommendationsThis helps remove obvious runtimes, SDK fragments, and system-managed components from the reinstall target list.
pwsh -File .\scripts\Resolve-WingetPackages.ps1 -MaxApps 20
pwsh -File .\scripts\Update-LatestAppVersions.ps1 -MaxApps 20pwsh -File .\scripts\Find-AppInstallers.ps1 -SearchRoot C:\Installers,$env:USERPROFILE\Downloadspwsh -File .\scripts\Prepare-AppInstallers.ps1 -DownloadWithWingetpwsh -File .\scripts\Get-ManualSourceQueue.ps1 -Format Table -UpdateCatalogIf the catalog already contains trusted installer.manualReferenceUrl values and you want to try downloading them into the stage folder:
pwsh -File .\scripts\Download-ManualReferenceInstallers.ps1pwsh -File .\scripts\Install-PreparedApps.ps1 -Mode PlanReview the generated plan before any execution step.
pwsh -File .\scripts\Install-PreparedApps.ps1 -Mode ExecuteTo review a checklist first and deselect apps you do not want to process:
pwsh -File .\scripts\Install-PreparedApps.ps1 -Mode Execute -InteractiveChecklistChecklist controls:
- Up/Down arrows: move cursor
- Space: tick/untick highlighted app
A: select allN: select noneDor Enter: doneCor Esc: cancel
| Script | Purpose |
|---|---|
AppReinstall.ps1 |
Guided workflow wrapper that exposes Doctor, Validate, Capture, Initialize, Status, Prepare, Plan, and Execute |
backup-app-list.ps1 |
Creates a timestamped backup pack from an existing machine, including the import-ready installed-programs.csv used by this repo |
backup-app-settings.ps1 |
Copies a small set of app settings folders and color profiles into a timestamped backup folder |
Get-InstalledPrograms.ps1 |
Reads installed-program data from the local machine and outputs table, JSON, or CSV |
Initialize-AppCatalog.ps1 |
Creates catalog/apps.json from installed-programs.csv |
Sync-AppCatalog.ps1 |
Re-checks the machine and updates each app status |
Classify-AppCatalog.ps1 |
Assigns buckets such as application, runtime, sdk, driver, browser, or developer-tool |
Resolve-WingetPackages.ps1 |
Finds likely winget package candidates and stores the best match |
Update-LatestAppVersions.ps1 |
Refreshes latest.version for apps that already have a wingetId |
Find-AppInstallers.ps1 |
Searches local folders for likely installer files |
Prepare-AppInstallers.ps1 |
Copies or downloads installers from local paths and winget into staged-installers/ and writes output/install-queue.json |
Get-ManualSourceQueue.ps1 |
Produces a queue of unresolved apps that still need vendor, Microsoft, OEM, or archive lookup |
Download-ManualReferenceInstallers.ps1 |
Attempts to download installers from cataloged manual reference URLs into staged-installers/ and writes output/manual-download-queue.json |
Set-AppStatus.ps1 |
Manually overrides one catalog entry |
Install-PreparedApps.ps1 |
Generates an install plan and can run supported installers |
Each app entry in catalog/apps.json includes fields such as:
name,publisher,expectedVersiondesiredandstatusdetection.*for last-seen metadata and match namesclassification.*for bucket, recommendation, and rationalelatest.*for current package version informationinstaller.*for local candidates, selected installer path,wingetmetadata, manual-source hints, staging path, and readinessnotesfor any manual annotations
This structure is designed to keep all reinstall-related decisions close to the application record they affect.
Because catalog/apps.json is ignored by Git, this catalog is treated as local working state rather than a shared repository artifact.
The scripts can generate artifacts such as:
output/preflight-report.jsonoutput/sync-report.jsonoutput/winget-report.jsonoutput/latest-version-report.jsonoutput/classification-report.jsonoutput/installer-report.jsonoutput/manual-source-queue.jsonoutput/manual-download-queue.jsonoutput/install-queue.jsonoutput/install-plan.jsonoutput/install-log.jsonoutput/validation-report.jsonstaged-installers/
These files are intended as working data, not long-term source files.
The repository includes Pester tests under tests/.
Run them from the repository root:
Invoke-Pester .\testsThe checked-in tests use modern Should -Be assertions, so use Pester 5 or newer rather than the older Windows PowerShell inbox Pester 3.x module.
Current coverage is targeted rather than comprehensive. The checked-in tests validate catalog structure handling and install-plan behavior for ready MSI items and unsupported EXE silent-install cases.
- Prefer
Install-PreparedApps.ps1 -Mode Planbefore any execution. - EXE installers may require explicit silent arguments in
installer.installArgsbefore they are safe to run unattended. - Review
wingetmatches and local installer candidates before trusting them as final. - Device drivers, OEM utilities, and licensed software often need vendor-specific handling even when they appear in the catalog.
This workflow operates on machine-derived data. Files such as installed-programs.csv, catalog/apps.json, generated reports, and staged installer paths can reveal:
- installed software inventory
- usernames and local file paths
- internal tooling names
- vendor portals or licensed software usage
The tracked installed-programs.csv in this repository is only a generic sample. Replace it with a real export for actual use, and do not commit your machine-specific replacement back to a public repository.
If you use this repository publicly, treat generated files and real inventory exports as environment-specific data and sanitize or exclude them before publishing.
docs/project-evaluation.mddocuments the current project scope, strengths, weaknesses, and verification limits for this checkout
MIT
- The repository is Windows-focused.
wingetmatching is heuristic and may need manual correction.- Automatic execution currently covers
msipackages,winget install, andexeinstallers when silent arguments are known. - Some applications will always remain manual because they are licensed, OEM-specific, legacy, or not available from a trusted package source.