PowerShell / PowerShell/PowerShell

Setup hangs when execution Policy is set to allsigned via GPO.

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

Nobody has claimed this yet.

Issue-Bug Needs-Triage WG-Maintainers-Build
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Prerequisites
Steps to reproduce
  1. Set (Or deploy via Domain Controller GPO) the Powershell Core Policy: “Turn on Script Execution” to “Enabled” and “Allow only Signed Scripts”
  2. Execute the installer in the system context with “msiexec.exe /package PowerShell-7.1.4-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1”
  3. Msi.exe will never exit. MSI log indicates it is waiting on the register manifest script. Pwsh.exe is running in the background and never exits because it is waiting on a prompt shown in the mail below.
Expected behavior
Setup should not hang due to unsigned components.
Actual behavior
Setup hangs and never terminates until PWSH.exe is terminated.
Error details
Do you want to run software from this untrusted publisher?
File C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.format.ps1xml is published by CN=Microsoft
Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts
from trusted publishers.
[V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help (default is "D"): A
PS C:\Windows\System32>
Environment data
Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

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 hang with the listed msiexec command while the PowerShell script execution policy is set to allow only signed scripts. Start with the MSI log and the register-manifest step, including the background pwsh prompt shown in the report. Done means setup exits without waiting for interactive approval from the unsigned component.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
operating-systems, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.