Skip to content

MSIX: declare uap17:UpdateWhileInUse = defer so Store updates don't kill running pwsh sessions #28272

Closed
MicrosoftDocs/PowerShell-Docs
#13357

Description

Summary of the new feature / enhancement

As a user of the MSIX package, I want a Store update of PowerShell to wait until my pwsh processes exit, so that an automatic update doesn't kill the shells, and the long-running programs inside them, that I'm in the middle of using.

Today the Store servicing stack force-closes every running pwsh.exe once its deferrals run out. On 2026-10-27 the 7.6.8 → 7.6.9 update did this on my machine (Windows 11 26H2, build 26300). From Microsoft-Windows-AppXDeploymentServer/Operational:

  1. Several earlier attempts (2026-10-26 and 2026-10-27) failed with event 419: error 0x80073D02: Unable to install because the following apps need to be closed Microsoft.PowerShell_7.6.8.0_x64__8wekyb3d8bbwe.
  2. Event 638 on the last deferred attempt reads Running apps: {Microsoft.PowerShell_8wekyb3d8bbwe!App} ... Number of previous attempts: 2, Is user session locked: false, Force update deferred by package: false.
  3. A few minutes later the next attempt logged event 9643 0x0: TerminateApplications successful. (four times). In the same second, the Application log recorded event 1002 The program pwsh.exe version 7.6.8.500 stopped interacting with Windows and was closed. Then the registration of 7.6.9 completed.

Every Windows Terminal tab whose shell was pwsh showed [process exited with code 1 (0x00000001)], and the processes running inside those shells were lost with them. The same forced termination appears in the log for the 7.6.8 update on 2026-10-23.

Windows Terminal, also an MSIX package on the same machine, doesn't behave this way. Its manifest declares <uap17:UpdateWhileInUse>defer</uap17:UpdateWhileInUse>, and an update blocked by its running instance on 2026-10-24 was deferred, not forced.

This was raised briefly in a comment on #27565 (2026-06-16), but it isn't listed among that issue's tracked gaps, so I'm filing it on its own.

Proposed technical implementation details (optional)

Declare the package-level deferral in assets/AppxManifest.xml:

<Package IgnorableNamespaces="uap mp rescap desktop6 uap17"
  ...
  xmlns:uap17="http://schemas.microsoft.com/appx/manifest/uap/windows10/17">
  ...
  <Properties>
    ...
    <uap17:UpdateWhileInUse>defer</uap17:UpdateWhileInUse>
  </Properties>

Per the uap17:UpdateWhileInUse reference, with defer the OS defers the update until the app restarts or the system reboots, and ignores the force-shutdown deployment options. Required OS updates and reboots still close it. The element needs Windows 11 24H2 (build 26100). Listing uap17 in IgnorableNamespaces should let the package keep its current MinVersion="10.0.17763.0", with older builds ignoring the element.

Environment where this was observed:

PSVersion                 7.6.9
PSEdition                 Core
GitCommitId               7.6.9
OS                        Microsoft Windows 10.0.26300
Platform                  Win32NT

Windows Terminal 1.24.12741.0.

Activity

  1. OKAN-SOFTWARE commented on Oct 28, 2026

    @OKAN-SOFTWARE
    Contributor

    Hi! I'd like to work on this.

    I checked assets/AppxManifest.xml, and the update deferral setting isn't currently declared.

    I'm planning to add the appropriate uap17 namespace and UpdateWhileInUse setting, then validate the manifest and check compatibility with older supported Windows versions.

    Please let me know if there are any additional packaging considerations I should account for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions