PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

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

Open travisgr opened this issue 5 years ago • 3 comments

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

travisgr avatar Oct 07 '21 22:10 travisgr

@travisgr Can you confirm this for 7.2 Preview version too?

iSazonov avatar Oct 08 '21 04:10 iSazonov

Yes, this seems to be reproducible with 7.2.0-Preview.

Command line used: msiexec.exe /package PowerShell-7.2.0-preview.10-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1

travisgr avatar Oct 08 '21 15:10 travisgr

This issue persists with 7.3.4. Changing HKLM\Software\Policies\Microsoft\PowerShellCore\ExecutionPolicy to Unrestricted allows the install to complete.

celticguy42 avatar Jun 19 '23 13:06 celticguy42