Skip to content

Instantly share code, notes, and snippets.

@jwmoss
Last active June 23, 2023 17:23
Show Gist options
  • Save jwmoss/aba550be9e2fa34e682ba1b0ac7bd158 to your computer and use it in GitHub Desktop.
Save jwmoss/aba550be9e2fa34e682ba1b0ac7bd158 to your computer and use it in GitHub Desktop.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls1
$code= @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) {
return true;
}
}
"@
Add-Type -TypeDefinition $code -Language CSharp
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
$wc = New-Object System.Net.WebClient
$wc.DownloadFile("https://downloadmirror.intel.com/739771/LAN-Win11-1.1.3.34.zip" , "C:\LAN-Win11-1.1.3.34.zip")
$wc.Dispose()
New-item -Path "C:\Drivers" -Name "NUCDrivers" -ItemType Directory -Force
Expand-Archive -Path "C:\LAN-Win11-1.1.3.34.zip" -DestinationPath "C:\Drivers\NUCDrivers"
Get-ChildItem -Path "C:\Drivers\NUCDrivers" -Recurse | ForEach-Object {
pnputil.exe /add-driver "$($_.FullName)" /install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment