doc/devdocs/modules/cmdpal/powertoys-extension-local-development.md
This guide is for iterating on src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PowerToys/Microsoft.CmdPal.Ext.PowerToys.csproj.
The extension is registered through the shared sparse package defined in src/PackageIdentity/AppxManifest.xml. That manifest declares Microsoft.CmdPal.Ext.PowerToys.exe relative to the sparse package's ExternalLocation (WinUI3Apps\ subfolder), so the sparse package and the extension must be built for the same platform and configuration, for example x64\Debug.
Build src/PackageIdentity/PackageIdentity.vcxproj.
This creates PowerToysSparse.msix in the repo output root for the selected platform and configuration, and prints the Add-AppxPackage command you should run next.
Trust the development certificate before running Add-AppxPackage.
The PackageIdentity build creates or reuses src/PackageIdentity/.user/PowerToysSparse.certificate.sample.cer.
Import it into CurrentUser\TrustedPeople:
$repoRoot = "C:/git/PowerToys"
Import-Certificate -FilePath "$repoRoot/src/PackageIdentity/.user/PowerToysSparse.certificate.sample.cer" -CertStoreLocation Cert:\CurrentUser\TrustedPeople
If Windows still reports a trust failure such as 0x800B0109, also import the same certificate into Cert:\CurrentUser\TrustedRoot.
Run the Add-AppxPackage command printed by the PackageIdentity build.
That registers Microsoft.PowerToys.SparseApp as a sparse package and points it at the matching output root through -ExternalLocation.
The command will look like this:
Add-AppxPackage -Path "<repo>\<Platform>\<Configuration>\PowerToysSparse.msix" -ExternalLocation "<repo>\<Platform>\<Configuration>\WinUI3Apps"
Build src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PowerToys/Microsoft.CmdPal.Ext.PowerToys.csproj in the same platform and configuration.
This project writes Microsoft.CmdPal.Ext.PowerToys.exe into the WinUI3Apps\ subfolder of the output root, such as x64\Debug\WinUI3Apps or ARM64\Debug\WinUI3Apps. That matches the Executable="Microsoft.CmdPal.Ext.PowerToys.exe" entry in src/PackageIdentity/AppxManifest.xml resolved relative to the sparse package's ExternalLocation.
Restart Command Palette.
Close any running CmdPal instance and launch it again so it reloads app extensions and picks up the rebuilt Microsoft.CmdPal.Ext.PowerToys binaries.
PackageIdentity when the sparse package manifest changes, the signing certificate changes, or you switch to a different output root such as ARM64\Debug.Microsoft.CmdPal.Ext.PowerToys, rebuilding the extension project and restarting CmdPal is enough.