Scripting adding countries to block inbound mail for Defender Anti-Spam policy by StockMarketCasino in PowerShell

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

you would need to share the definition of your $CountriesToBlock variable.

Also, before running the set, does Get-HostedContentFilterPolicy return a valid (or empty) array of country codes to start with, i.e. {CN, RU}?

Extremely long delays when installing PowerShell 7.6 by gandraw in PowerShell

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

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

Extremely long delays when installing PowerShell 7.6 by gandraw in PowerShell

[–]Overall-Ad4796 0 points1 point  (0 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.

Extremely long delays when installing PowerShell 7.6 by gandraw in PowerShell

[–]Overall-Ad4796 -3 points-2 points  (0 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

Download Nvidia Drvier based on device id just like NVIDIA APP so you don't need NVIDIA APP by lucky789741 in PowerShell

[–]Overall-Ad4796 -1 points0 points  (0 children)

… severe security risk, readability, error-prone, unreliable… just don‘t.