Clean up
Strip captured installer leftovers and unsupported artifacts.
Invoke-MSIXCleanupGuide
A “fix” in MSIXForcelets is just a function that opens an MSIX package,
applies a handful of framework cmdlets and repacks it. The built-in fixes
(Add-MSIXFixWinRAR, Add-MSIXFixNotepadPlusPlus …) all follow
the same shape — here is how to write your own.
Every fix is an advanced function named Add-MSIXFix<App> with a
consistent parameter block. It opens the package, does its work, then repacks —
all inside a try/catch.
function Add-MSIXFixMyApp {
[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipeline, Position=0)]
[System.IO.FileInfo] $MsixFile,
[System.IO.DirectoryInfo] $MSIXFolder = ($env:Temp + '\MSIX_' + [guid]::NewGuid()),
[System.IO.FileInfo] $OutputFilePath = $null,
[string] $Subject = '',
[switch] $Force,
[switch] $KeepMSIXFolder
)
process {
if (-not $OutputFilePath) { $OutputFilePath = $MsixFile }
try {
Open-MSIXPackage -MsixFile $MsixFile -MSIXFolder $MSIXFolder -Force:$Force
if ($Subject) { Set-MSIXPublisher -MSIXFolder $MSIXFolder -PublisherSubject $Subject }
# --- your building blocks go here (see step 2) ---
Close-MSIXPackage -MSIXFolder $MSIXFolder -MSIXFile $OutputFilePath `
-Force:$Force -KeepMSIXFolder:$KeepMSIXFolder
}
catch { Write-Error "Error applying MyApp fix: $_" }
}
}
Drop in only what the app needs. Each links to its reference entry.
Strip captured installer leftovers and unsupported artifacts.
Invoke-MSIXCleanupDeclare what the app needs, e.g. internetClient.
Add-MSIXCapabilitiesAdd a loader search path and installed-location virtualization.
Add-MSIXloaderSearchPathOverrideShip the PSF binaries and wire every app through the launcher.
Add-MSIXPsfFrameworkFiles · Add-MSXIXPSFShimNormalise HKCU/HKLM access; optional HKLM→HKCU redirection.
Add-MSIXPSFDefaultRegLegacyTim Mangan MFR (ILV-aware) and dynamic library fixups.
Add-MSIXPSFMFRFixupAdd a working Start Menu / Desktop shortcut with a PNG icon.
Add-MSIXDesktop7ShortcutRemove captured services and dependencies that block activation.
Remove-MSIXServices · Remove-MSIXDependenciesA typical PSF-based fix — modelled on Add-MSIXFixWinRAR:
# 1. clean captured leftovers
Invoke-MSIXCleanup -MSIXFolder $MSIXFolder
# 2. capabilities the app needs
Add-MSIXCapabilities -MSIXFolder $MSIXFolder -Capabilities 'internetClient'
# 3. let the loader find sibling DLLs
Add-MSIXloaderSearchPathOverride -MSIXFolderPath $MSIXFolder -FolderPaths 'VFS\ProgramFilesX64\MyApp'
Add-MSIXInstalledLocationVirtualization -MSIXFolderPath $MSIXFolder
# 4. wire every application through the PSF launcher
Add-MSIXPsfFrameworkFiles -MSIXFolder $MSIXFolder
foreach ($app in (Get-MSIXApplications -MSIXFolder $MSIXFolder)) {
Add-MSXIXPSFShim -MSIXFolder $MSIXFolder -MISXAppID $app.Id -PSFArchitektur x64
}
# 5. registry + file-redirection fixups
Add-MSIXPSFDefaultRegLegacy -MSIXFolder $MSIXFolder
Add-MSIXPSFMFRFixup -MSIXFolder $MSIXFolder -IlvAware $true
PSF cmdlets need an active framework. Run the fix, sign the result, install and inspect:
Set-MSIXActivePSFFramework -Framework TimManganPSF # required for shims/fixups
Add-MSIXFixMyApp -MsixFile 'C:\Apps\MyApp.msix' `
-OutputFilePath 'C:\Apps\MyApp_fixed.msix' -Verbose
$cert = New-MSIXSelfSigningCert -Subject 'CN=Test' -Password 'pw'
Set-MSIXSignature -MSIXFile 'C:\Apps\MyApp_fixed.msix' -PfxCert $cert
# when something hangs or fails to launch:
Wait-MSIXTracing # ETW trace start/stop around a launch
Tip: run with -KeepMSIXFolder to inspect the expanded package, and pair
the ETW trace with Process Monitor (filter Result = NAME NOT FOUND / ACCESS DENIED)
to find what the app is missing.
Save the function as src/Public/Add-MSIXFixMyApp.ps1; the module auto-exports
everything in Public/. Your .SYNOPSIS line automatically appears in the
cmdlet reference. Got a fix for a common app?
Open a pull request — the goal of
this project is a growing library of ready-made solutions.