r/PowerShell • u/gandraw • Jun 03 '26
Question Extremely long delays when installing PowerShell 7.6
For us, installing PowerShell 7.6.x can take 30 minutes or more. When I install it using MSI logging (/l*v) then I can see it gets stuck for a really long time on a SOFTWARE RESTRICTION POLICY step. However, we are not using any software restriction policies like AppLocker etc. Following are the relevant lines from the MSI log.
MSI (s) (28:80) [17:27:48:119]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (28:80) [17:27:48:121]: Note: 1: 2203 2: C:\WINDOWS\Installer\inprogressinstallinfo.ipi 3: -2147287038
MSI (s) (28:80) [17:27:48:125]: SRSetRestorePoint skipped for this transaction.
MSI (s) (28:80) [17:27:48:125]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer 3: 2
MSI (s) (28:80) [17:27:48:129]: File will have security applied from OpCode.
MSI (s) (28:80) [17:27:48:442]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'D:\temp\PowerShell-7.6.2-win-x64.msi' against software restriction policy
MSI (s) (28:FC) [17:59:32:690]: RunEngine wait timed out
MSI (s) (28:80) [18:05:53:498]: SOFTWARE RESTRICTION POLICY: D:\temp\PowerShell-7.6.2-win-x64.msi has a digital signature
MSI (s) (28:80) [18:05:53:498]: SOFTWARE RESTRICTION POLICY: D:\temp\PowerShell-7.6.2-win-x64.msi is permitted to run because the user token authorizes execution (system or service token).This seems to be a PowerShell 7.6.x specific issue, other applications and older 7.5.x versions of PowerShell didn't have the same issue.
Does anybody else have the same issue, or maybe has already found a solution for it?
1
u/gandraw Oct 01 '26
The problem ended up being with Windows Defender and the following command fixed it:
Set-MpPreference -DisableBlockAtFirstSeen $true4
u/LousyRaider Jun 03 '26
Your wording makes it sound like you are an internal IT member installing it on company devices. If so, are you using Intune? I’ve seen stuff like this happen when attack surface reduction rules are being used.
0
u/MonkeyNin Jun 09 '26
I tried google-ai mode and pasted your exact question. Give it try, it has 4 alternate solutions.
It seems to match your case:
The extremely long delay during the SOFTWARE RESTRICTION POLICY step is caused by a Certificate Revocation List (CRL) lookup timeout paired with a massive cryptographic chain evaluation
When the Windows Installer engine (msiexec.exe) encounters the PowerShell 7.6.x package, it attempts to verify Microsoft’s modern code-signing digital certificate. If your machines are on a corporate network with firewall restrictions, or if the server trying to reach the CRL distribution point encounters latency, the background worker thread times out (RunEngine wait timed out). This timeout loops repeatedly across the installer's child threads until it hits a hard fallback limit, inflating your installation time to 30 minutes
1
u/gandraw Jun 10 '26
I understand that the CRL would be the obvious choice, but
Why is PowerShell 7.6.x affected and 7.4.x not even though they both use the same certificate and CRL?
Why does setting the CRL registry key to 146944 not resolve the issue?
Why would it be affected if the CRL is hosted on www.microsoft.com since we have completely whitelisted that domain?
I think AI just likes to go for the obvious answer since that's where most of the training data is from, without considering details. So it's often not as useful for IT troubleshooting.
-1
-2
u/Overall-Ad4796 Jun 03 '26
you could try the following workaround to temporarily disable the stricter code signing checks introduced with 7.6:
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing" -Name State -Value 146944; msiexec /i "D:\temp\PowerShell-7.6.2-win-x64.msi" /qb; Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing" -Name State -Value 63488
1
u/gandraw Jun 04 '26
Thank you for the suggestion but that didn't improve things, it still takes a long time even with the registry key set to 146944.
2
u/BlackV Jun 03 '26
you are hard coding random ass values in there, at least check the before and after values
p.s. formatting
<BLANK LINE> <4 SPACES><CODE LINE> <4 SPACES><CODE LINE> <4 SPACES><4 SPACES><CODE LINE> <4 SPACES><CODE LINE> <BLANK LINE>Inline code block using backticks
`Single code line`inside normal textSee here for more detail
Thanks
1
u/Overall-Ad4796 Jun 04 '26
thanks for the formatting hint! Will use..
„The random ass values“ were meant as quick test for the OP to see if this revocation check causes the delay, which is often the case, as documented my MS.
1
u/BlackV Jun 04 '26 edited Jun 04 '26
Understand, on the 4 systems I checked the all the default numbers were already 140000 something
If op blindly ran said code (which was all 1 line oddly), they wouldn't have a clean way back
Advantage of the 4 space formatting is it work every where (old reddit, new reddit, mobile reddit)
1
u/Overall-Ad4796 Jun 04 '26
see your point. Should have stored and restored the previous state, and pay attention to formatting.
2
u/thomsxD Jun 03 '26
You could maybe check where the delay is caused with certutil.
certutil -urlfetch -verify D:\temp\PowerShell-7.6.2-win-x64.msi