#28117·PowerShell

PowerShell MSIX pwsh.exe returns Access Denied when launched by multiple terminal applications

Author: xdeleon04Created Sep 28, 2026Updated Sep 28, 2026
LabelsNeeds-Triage

Prerequisites

Steps to reproduce

  1. Install PowerShell 7.6.6 using WinGet:
powershell
winget install --id Microsoft.PowerShell

The WinGet package installs the MSIX variant. Verify that pwsh.exe resolves through the Windows App Execution Alias:

powershell
where.exe pwsh
(Get-Command pwsh).Source

Expected result:

C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe
  1. Open Windows Terminal and start PowerShell 7:
powershell
pwsh

Leave the PowerShell session running.

  1. Open GitHub Copilot App and open a terminal in a project/worktree.

GitHub Copilot App attempts to launch PowerShell using a command similar to:

C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe --nologo -ExecutionPolicy Bypass -NoExit -Command ". '<path>\terminal-integration\shellIntegration.ps1'"
  1. The GitHub Copilot terminal fails to start with:
Failed to spawn PTY command: CreateProcessW ... failed: Access is denied. (os error 5)
  1. The reverse sequence also reproduces the problem. If the GitHub Copilot terminal is started first, then attempting to launch PowerShell from Windows Terminal fails with:
[error 2147942405 (0x80070005) when launching "C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe" --nologo]
  1. Remove the MSIX installation and install the MSI version of the same PowerShell release:
powershell
winget uninstall --id Microsoft.PowerShell

Then install the MSI package of PowerShell 7.6.6.

powershell
winget install --id Microsoft.PowerShell --source winget --installer-type wix

After installation:

powershell
where.exe pwsh

resolves to:

C:\Program Files\PowerShell\7\pwsh.exe
  1. Repeat the same Windows Terminal ↔ GitHub Copilot App test.

Both applications can now launch independent PowerShell processes concurrently without errors.

The PowerShell version remains 7.6.6 in both cases, so the difference is the installation/package type and executable path rather than the PowerShell version itself.

Expected behavior

bash
Independent terminal applications should be able to launch separate PowerShell processes concurrently within the same Windows user session.

An existing PowerShell process launched by one terminal application should not prevent another terminal application from creating a new `pwsh.exe` process.

The MSIX/App Execution Alias at:


%LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe


should behave equivalently to the normal PowerShell executable when used to create independent processes.

Actual behavior

bash
When PowerShell 7.6.6 is installed as the MSIX package, launching `pwsh.exe` from a second terminal application fails with `ERROR_ACCESS_DENIED (5)` / `0x80070005` if another terminal application already has an MSIX-installed PowerShell process running.

The failure occurs in both directions:

* Windows Terminal → GitHub Copilot App: Copilot fails to create the PowerShell process.
* GitHub Copilot App → Windows Terminal: Windows Terminal fails to create the PowerShell process.

The failure occurs before PowerShell starts executing commands. In the GitHub Copilot case, `CreateProcessW` fails while attempting to create the process, so `shellIntegration.ps1` is not reached.

Installing the MSI version of the exact same PowerShell release changes the executable to:


C:\Program Files\PowerShell\7\pwsh.exe


and the problem disappears. Windows Terminal and GitHub Copilot App can then run PowerShell simultaneously.

This makes the MSIX/App Execution Alias path a significant differentiating factor in the reproduction.

Error details

bash
GitHub Copilot App:


Failed to spawn PTY command: CreateProcessW `"C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe --nologo -ExecutionPolicy Bypass -NoExit -Command ". '<path>\terminal-integration\shellIntegration.ps1>'"` failed: Access is denied. (os error 5)


Windows Terminal:


[error 2147942405 (0x80070005) when launching "C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe" --nologo]


The important error is:


ERROR_ACCESS_DENIED (5)
0x80070005


The error is returned while creating the process rather than from a PowerShell command executed inside the new process.

Environment data

powershell
PS> $PSVersionTable | Format-List

Name  : PSVersion
Value : 7.6.6

Name  : PSEdition
Value : Core

Name  : GitCommitId
Value : 7.6.6

Name  : OS
Value : Microsoft Windows 10.0.26200

Name  : Platform
Value : Win32NT

Name  : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}

Name  : PSRemotingProtocolVersion
Value : 2.4

Name  : SerializationVersion
Value : 1.1.0.1

Name  : WSManStackVersion
Value : 3.0


MSIX installation:


PS> where.exe pwsh
C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe

PS> (Get-Command pwsh).Source
C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\pwsh.exe


The MSIX package was installed using WinGet:


winget install --id Microsoft.PowerShell


After replacing the MSIX installation with the MSI installation of the same PowerShell 7.6.6 release:


winget install --id Microsoft.PowerShell --source winget --installer-type wix



PS> where.exe pwsh
C:\Program Files\PowerShell\7\pwsh.exe


The MSI installation does not exhibit the concurrent-launch failure.

Visuals

No response

Related issues

There are several related reports involving PowerShell's MSIX/App Execution Alias and pwsh.exe under %LOCALAPPDATA%\Microsoft\WindowsApps:

#27565 — Tracking: MSIX packaging gaps for PowerShell 7 #27603 — PowerShell from Microsoft Store is causing problems on Codex GitHub/App#2820 — Terminal failed to start with "Access is denied" microsoft/terminal#20201 — error 0x80070780 when starting pwsh.exe OpenAI/Codex#38222 — Windows sandbox: restricted token cannot enumerate or execute under the user profile

Windows Terminal #20201 is particularly relevant because it involves PowerShell launched through the MSIX App Execution Alias on Windows build 26200, and a Terminal maintainer specifically identified the App Execution Alias as a likely culprit.

The failure described in this report is different: it occurs during normal process creation between independent terminal applications when one PowerShell process is already running. The same PowerShell 7.6.6 installation works correctly when installed via MSI, where pwsh.exe resolves to C:\Program Files\PowerShell\7\pwsh.exe.

I am not assuming these reports have the same root cause, but the shared MSIX/App Execution Alias path and process-launch failures may be related.