Run Store-app pwsh As Administrator, but administrator is a different user #13007

Open
opened 2026-01-31 03:31:17 +00:00 by claunia · 0 comments
Owner

Originally created by @NebulousPsychology on GitHub (Mar 13, 2021).

Environment

Windows build number: Win32NT  10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.7.572.0

Any other software?
pwsh (Microsoft.PowerShell_8wekyb3d8bbwe) 7.1.3, via the Store
powershell.exe 5.1.19041.610 present by default

Steps to reproduce

  • In an environment with a local admin user and a non-admin user, both user accounts having installed Terminal Preview and Pwsh from the Store. (installed in no particular order, could that matter?)

    aside: it was some time before realizing both user accounts would need a copy of each app

  • logged in as the non-admin user, from the taskbar or Start, select Run As Administrator on Terminal Preview
  • UAC launches, log in as the Admin user account without complaint

Expected behavior

A pwsh tab, as admin, in admin's $Home directory.

Actual behavior

A pwsh tab appears:

[error 0x80070780 when launching `C:\<admin's $home>\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe']

Additionally

  • If a Powershell Desktop tab is opened in the same window, it correctly opens to the admin user's $Home directory (Terminal is correctly elevated, so it's pwsh specifically that isn't being normal)
  • If pwsh is Run As Administrator'd directly from Start, it opens an elevated C:\Program Files\WindowsApps\Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe\pwsh.exe
    • note differing file path though: yet both exist
    • Terminal has perhaps mapped pwsh from a path that is somehow wrong, but ONLY when run as administrator?
Originally created by @NebulousPsychology on GitHub (Mar 13, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Win32NT 10.0.19041.0 Microsoft Windows NT 10.0.19041.0 Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.7.572.0 Any other software? pwsh (Microsoft.PowerShell_8wekyb3d8bbwe) 7.1.3, via the Store powershell.exe 5.1.19041.610 present by default ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> - In an environment with a local admin user and a non-admin user, both user accounts having installed Terminal Preview and Pwsh from the Store. (installed in no particular order, could that matter?) > aside: it was some time before realizing both user accounts would need a copy of each app - logged in *as the non-admin user*, from the taskbar or Start, select Run As Administrator on Terminal Preview - UAC launches, log in as the Admin user account without complaint # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> A pwsh tab, as admin, in admin's $Home directory. # Actual behavior A pwsh tab appears: ```text [error 0x80070780 when launching `C:\<admin's $home>\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe'] ``` # Additionally - If a Powershell Desktop tab is opened in the same window, it correctly opens to the admin user's $Home directory (Terminal is correctly elevated, so it's pwsh specifically that isn't being normal) - If pwsh is Run As Administrator'd directly from Start, it opens an elevated `C:\Program Files\WindowsApps\Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe\pwsh.exe` - note differing file path though: yet both exist - Terminal has perhaps mapped pwsh from a path that is somehow wrong, but ONLY when run as administrator?
claunia added the Resolution-Duplicate label 2026-01-31 03:31:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13007