microsoft / microsoft/winget-cli

Elevation Prompt in the Background for PowerShell Cmdlets

Open
#5,591 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug PowerShell
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

When using PowerShell Cmdlets to update or install applications, if the installer requires elevation, the UAC prompt is opened in the background.

Steps to reproduce

Run Update-WinGetPackage on a package that requires elevation (.NET SDKs for example)

Expected behavior

The UAC prompt to be in the foreground

Actual behavior

The UAC prompt opens in the background, requiring me to switch to it

Environment
Windows: Windows.Desktop v10.0.26450.1000
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.26.410.0
Additional Info

I suspect the cmdlets need to use CoAllowSetForegroundWindow

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with Update-WinGetPackage on a package requiring elevation, such as a .NET SDK, and inspect the PowerShell cmdlet elevation flow. Investigate the mentioned CoAllowSetForegroundWindow API; done means the UAC prompt consistently opens in the foreground.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.