When Windows Installer cache files (C:\Windows\Installer\*.msi / *.msp) are missing, updates and uninstalls can fail for products like SQL Server, Exchange, Azure Arc Agent, and others.
The original FixMissingMSI utility identifies and restores these files but is GUI-only.
FixMissingMSI.PowerShell turns that manual process into a repeatable, non-interactive workflow.
It lets you scan systems at scale, merge reports, and repopulate missing files from a shared cache - all orchestrated through PowerShell.
- Non-interactive execution of FixMissingMSI via .NET Reflection
- Works in both shared and local-only modes
- Centralized or standalone reporting of missing MSI/MSP files
- Shared cache support with demand-driven population
- Secure ACL design for file share permissions
- Advanced recovery helpers for MSI registration scrubbing
From the PowerShell Gallery:
Install-Module FixMissingMSI.PowerShell
Import-Module FixMissingMSI.PowerShellOr from source:
git clone https://github.com/ITJoeSchmo/FixMissingMSI.PowerShell
Import-Module ./src/FixMissingMSI.PowerShell.psd1| Function | Purpose |
|---|---|
Install-FixMissingMSI |
Download and stage FixMissingMSI locally in $env:TEMP\FixMissingMSI |
Initialize-InstallerCacheFileShare |
Prepare a file share with the tool and reports, apply scoped ACLs |
Invoke-InstallerCacheRepair |
Run FixMissingMSI non-interactively (supports local-only or shared) |
Merge-InstallerCacheReports |
Merge host reports into a deduplicated summary |
Update-InstallerCache |
Populate the shared cache with only the required MSI/MSP files |
Invoke-InstallerCacheRepaircan now run without -FileSharePath, automatically detecting FixMissingMSI in$env:TEMP\FixMissingMSI.
UseInstall-FixMissingMSIbeforehand to stage the tool locally.
| Parameter | Type | Description |
|---|---|---|
| FileSharePath | String |
Optional UNC path where the shared FixMissingMSI directory exists (e.g. \\FS01\Software). When omitted, the function assumes FixMissingMSI is installed locally under $env:TEMP\FixMissingMSI |
| SourcePaths | String[] |
One or more local or UNC paths containing MSI/MSP to scan as source for recovering missing files. By default, it also checks the shared cache (e.g. \\FS01\Software\FixMissingMSI\Cache\{Products, Patches}). |
| LocalWorkPath | String |
Local directory where FixMissingMSI is staged and executed locally. Defaults to $env:TEMP\FixMissingMSI. |
| RunFromShare | Switch |
Runs FixMissingMSI directly from the network share instead of copying locally. |
| ReportOnly | Switch |
Performs discovery and reporting only -- no 'FixCommands' are executed, but still logs all FixCommands to the transcript and exports unresolved entries to CSV.. Useful for audit-only scans. |
For full syntax, parameters, examples of other functions run:
Get-Help <function> -Full
| Function | Purpose |
|---|---|
Get-InstallerRegistration |
Lists MSI-registered products from the Windows Installer registry. |
Remove-InstallerRegistration |
Forcefully removes or scrubs MSI registrations when standard uninstall or repair isn’t possible. |
⚠️ WarningRemove-InstallerRegistrationis an advanced recovery function adapted from Microsoft’s Program Install and Uninstall Troubleshooter (MSIMATSFN.ps1). It should be used only after standard uninstall or repair methods have failed.When invoked, the function first attempts a normal uninstallation by calling
msiexec /x <ProductCode>to remove program files and registry data through Windows Installer.
- After msiexec, the function runs the Rapid Product Removal (RPR) phase, which scrubs Windows Installer registration, cached metadata, and uninstall entries so that the product can be reinstalled.
- When run with
-DeepClean, it additionally performs Microsoft’s LPR phase, which locates and purges related files, shims, ARP entries, and orphaned registry keys.During either cleanup phase, the function automatically:
- Backs up files and registry data related to the target product under
C:\MATS\<ProductCode>\- Generates a PowerShell restore script (
RestoreYourFilesAndRegistry.ps1) in the same directory, which can be used to revert any changes if needed.These backups are created before any deletion occurs, allowing administrators to inspect or restore the removed data manually if necessary.
This command is intended strictly as a last-resort recovery tool to enable clean reinstallation of affected software. Always verify backups or create a system restore point before use.
# Run in local-only mode (no file share)
Install-FixMissingMSI
Invoke-InstallerCacheRepair -ReportOnly
# Deploy with FileShare to enable a shared cache to be leveraged
# Initialize cache share
Initialize-InstallerCacheFileShare -FileSharePath "\\FS01\InstallerCache"
# Scan a system and try to source missing files from "\\FS01\SQLServer2019\setup\"
Invoke-InstallerCacheRepair -FileSharePath "\\FS01\InstallerCache" -SourcePaths "\\FS01\SQLServer2019\setup\"
# Merge reports
Merge-InstallerCacheReports -FileSharePath "\\FS01\InstallerCache"
# Populate shared cache
Update-InstallerCache -FileSharePath "\\FS01\InstallerCache"Version 1.1.5 introduces local-only repair mode, allowing FixMissingMSI to run without a network share. This is ideal for disconnected or single-system repair scenarios. Full example workflows are provided under examples/.
This project automates recovery for:
The cached MSI file 'C:\Windows\Installer\xxxxxx.msi' is missingSQL Server Setup has encountered the following error: The cached MSI file is missingMissing MSI/MSP files prevent service pack or cumulative update installation
- The application folder is read/execute only for Domain Computers
- Cache and reports folders are writable as scoped
- Servers cannot write to the tool folder itself
FixMissingMSI is a WinForms GUI with no CLI support. This module loads the EXE via .NET Reflection, instantiates its form classes to initialize internal state, and invokes internal methods directly.
- FixMissingMSI authored by suyouquan (Simon Su @ Microsoft)
- Installer-registration helper functions adapted from Microsoft’s Program Install and Uninstall Troubleshooter
- Add orchestration examples for Ansible and Azure Arc
- Evaluate replacing FixMissingMSI dependency with native implementation (
Update-InstallerCachealready functions independently)
MIT License © 2025 Joey Eckelbarger