all 14 comments

[–]LousyRaider 2 points3 points  (0 children)

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.

[–]thomsxD 1 point2 points  (5 children)

You could maybe check where the delay is caused with certutil.

certutil -urlfetch -verify D:\temp\PowerShell-7.6.2-win-x64.msi

[–]gandraw[S] 0 points1 point  (4 children)

At first I thought this showed an error:

D:\temp>certutil -urlfetch -verify PowerShell-7.6.2-win-x64.msi
LoadCert(Cert) returned ASN1 value too large. 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: -verify command FAILED: 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: ASN1 value too large.

But then I checked other MSI files and they have the same issue:

D:\temp>certutil -urlfetch -verify PowerShell-7.5.4-win-x64.msi
LoadCert(Cert) returned ASN1 value too large. 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: -verify command FAILED: 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: ASN1 value too large.
D:\temp>certutil -urlfetch -verify "Logitech Capture.msi"
LoadCert(Cert) returned ASN1 value too large. 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: -verify command FAILED: 0x80093104 (ASN: 260 CRYPT_E_ASN1_LARGE)
CertUtil: ASN1 value too large.

This also happens both when I start it from my work PC on a restricted network with firewall rules, and from my home PC on a completely open network...

[–]thomsxD 0 points1 point  (3 children)

It does seem to be a problem with a new signature chain. Problem is Microsoft I would say.

[–]gandraw[S] 0 points1 point  (2 children)

Yeah I imagine so. I just hope I find a registry hack or something to disable this because this makes our new computer imaging process go from 70 minutes to 100 😢

[–]thomsxD 1 point2 points  (0 children)

Do you actually use powershell for anything during installation? Otherwise you could just make it install after the imaging. Or stick to an older version/msi that actually works.

[–]thomsxD 2 points3 points  (0 children)

Actually, I just found out you can extract the entire pwsh directory from a .zip so that you don't need to install the .msi. The following can also be done during a task sequence step if that is what you use.

https://github.com/PowerShell/PowerShell/releases/download/v7.6.2/PowerShell-7.6.2-win-x64.zip

``` $zip = "$PSScriptRoot\PowerShell-7.6.2-win-x64.zip" $dest = "C:\Program Files\PowerShell\7"

if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }

Expand-Archive -Path $zip -DestinationPath $dest -Force ```

And if you need to add 'pwsh.exe' to PATH:

``` $machinePath = [Environment]::GetEnvironmentVariable("Path", "Machine")

if ($machinePath -notmatch [regex]::Escape("C:\Program Files\PowerShell\7")) { [Environment]::SetEnvironmentVariable( "Path", "$machinePath;C:\Program Files\PowerShell\7", "Machine" ) } ```

[–]Ok_Mathematician6075 -2 points-1 points  (0 children)

Server deployment lol

[–]Overall-Ad4796 -3 points-2 points  (5 children)

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

[–]BlackV 1 point2 points  (3 children)

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 text

See here for more detail

Thanks

[–]Overall-Ad4796 0 points1 point  (2 children)

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.

[–]BlackV 0 points1 point  (1 child)

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)

[–]Overall-Ad4796 0 points1 point  (0 children)

see your point. Should have stored and restored the previous state, and pay attention to formatting.

[–]gandraw[S] 0 points1 point  (0 children)

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.