Files
loc_az_hci/infrastructure/drivers/install-intel-nic-drivers.ps1
defiQUG c39465c2bd
Some checks failed
Test / test (push) Has been cancelled
Initial commit: loc_az_hci (smom-dbis-138 excluded via .gitignore)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 09:04:46 -08:00

119 lines
4.1 KiB
PowerShell

# Install Intel NIC Drivers
# Supports: i350-T4, i350-T8, X550-T2, i225 Quad-Port
param(
[string]$DriverPath = "",
[switch]$Force = $false
)
$ErrorActionPreference = "Stop"
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Intel NIC Driver Installation" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
# Check if running as Administrator
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "This script requires Administrator privileges." -ForegroundColor Red
exit 1
}
# Detect Intel NICs
Write-Host "`nDetecting Intel network adapters..." -ForegroundColor Yellow
$intelNics = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like "*Intel*" }
if ($intelNics.Count -eq 0) {
Write-Host "No Intel network adapters detected." -ForegroundColor Red
exit 1
}
Write-Host "Found $($intelNics.Count) Intel network adapter(s):" -ForegroundColor Green
foreach ($nic in $intelNics) {
Write-Host " - $($nic.Name): $($nic.InterfaceDescription)" -ForegroundColor White
}
# Download Intel PROSet if not provided
if ([string]::IsNullOrEmpty($DriverPath)) {
Write-Host "`nDownloading Intel PROSet drivers..." -ForegroundColor Yellow
$downloadUrl = "https://downloadcenter.intel.com/download/25016/Intel-Network-Adapter-Driver-for-Windows-10"
$tempPath = "$env:TEMP\IntelPROSet.exe"
try {
Write-Host "Please download Intel PROSet from: $downloadUrl" -ForegroundColor Yellow
Write-Host "Save to: $tempPath" -ForegroundColor Yellow
Read-Host "Press Enter after downloading"
if (-not (Test-Path $tempPath)) {
Write-Host "Driver file not found at $tempPath" -ForegroundColor Red
exit 1
}
$DriverPath = $tempPath
}
catch {
Write-Host "Error downloading drivers: $_" -ForegroundColor Red
exit 1
}
}
# Install Intel PROSet
if (Test-Path $DriverPath) {
Write-Host "`nInstalling Intel PROSet drivers..." -ForegroundColor Yellow
$installArgs = "/S /v/qn"
if ($Force) {
$installArgs += " FORCE=1"
}
try {
$process = Start-Process -FilePath $DriverPath -ArgumentList $installArgs -Wait -PassThru -NoNewWindow
if ($process.ExitCode -eq 0 -or $process.ExitCode -eq 3010) {
Write-Host "Intel PROSet installed successfully." -ForegroundColor Green
}
else {
Write-Host "Installation completed with exit code: $($process.ExitCode)" -ForegroundColor Yellow
}
}
catch {
Write-Host "Error installing drivers: $_" -ForegroundColor Red
exit 1
}
}
else {
Write-Host "Driver file not found: $DriverPath" -ForegroundColor Red
exit 1
}
# Verify installation
Write-Host "`nVerifying driver installation..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
$updatedNics = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like "*Intel*" }
foreach ($nic in $updatedNics) {
$driverInfo = Get-NetAdapterDriver -Name $nic.Name
Write-Host " $($nic.Name): Driver Version $($driverInfo.DriverVersion)" -ForegroundColor Green
}
# Enable all Intel NICs
Write-Host "`nEnabling Intel network adapters..." -ForegroundColor Yellow
foreach ($nic in $updatedNics) {
if ($nic.Status -ne "Up") {
Enable-NetAdapter -Name $nic.Name -Confirm:$false
Write-Host " Enabled: $($nic.Name)" -ForegroundColor Green
}
else {
Write-Host " Already enabled: $($nic.Name)" -ForegroundColor Green
}
}
Write-Host "`n=========================================" -ForegroundColor Cyan
Write-Host "Intel NIC Driver Installation Complete" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
# Display final status
Write-Host "`nFinal Status:" -ForegroundColor Yellow
Get-NetAdapter | Where-Object { $_.InterfaceDescription -like "*Intel*" } | Format-Table Name, InterfaceDescription, Status, LinkSpeed -AutoSize