PowerShell
PowerShell copied to clipboard
Setup hangs when execution Policy is set to allsigned via GPO.
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest released version
- [X] Search the existing issues.
- [X] Refer to the FAQ.
- [X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Set (Or deploy via Domain Controller GPO) the Powershell Core Policy: “Turn on Script Execution” to “Enabled” and “Allow only Signed Scripts”
- 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”
- 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 Can you confirm this for 7.2 Preview version too?
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
This issue persists with 7.3.4. Changing HKLM\Software\Policies\Microsoft\PowerShellCore\ExecutionPolicy to Unrestricted allows the install to complete.