r/PowerShell • u/lucky789741 • May 16 '26
Script Sharing Download Nvidia Drvier based on device id just like NVIDIA APP so you don't need NVIDIA APP
function Get-NvidiaDriverUrl {
param([bool]$Laptop = $false, [bool]$Studio = $false)
$vid = '10DE'
$devs = Get-CimInstance Win32_VideoController -Filter "PNPDeviceID like '%$vid%'" |
Select-Object -ExpandProperty PNPDeviceID |
ForEach-Object { Get-PnpDevice -PresentOnly -DeviceId $_ }
if (!$devs) { $devs = Get-PnpDevice -PresentOnly -DeviceId "*$vid*" }
$gpus = @($devs | Where-Object { $_.Class -eq 'Display' -or $_.Class -eq '3D Video Controller' })
if (!$gpus) { $gpus = @($devs) }
$ids = @($gpus | ForEach-Object {
if ($_.DeviceID -match 'DEV_(\w{4}).*SUBSYS_(\w{4})(\w{4})') {
if ($Laptop) { "$($Matches[1])_$vid" }
else { "$($Matches[1])_$vid_$($Matches[2])_$($Matches[3])" }
}
})
if (!$ids) { return $null }
$v = [System.Environment]::OSVersion.Version
$body = [ordered]@{
dIDa = $ids
osC = "$($v.Major).$($v.Minor)"
osB = "$($v.Build)"
is6 = ('0','1')[[System.Environment]::Is64BitOperatingSystem]
lg = "$((Get-WinSystemLocale).LCID)"
iLp = ('0','1')[$Laptop]
prvMd = '0'
upCRD = ('0','1')[$Studio]
} | ConvertTo-Json -Compress
$body = [regex]::Unescape($body)
$r1 = Invoke-WebRequest -UseBasicParsing -ErrorAction Stop -Uri (
'https://gfwsl.geforce.com/nvidia_web_services/controller.gfeclientcontent.NG.php/' +
"com.nvidia.services.GFEClientContent_NG.getDispDrvrByDevid/$([uri]::EscapeDataString($body))"
)
if ($r1.StatusCode -ne 200) { return $null }
return (ConvertFrom-Json $r1.Content).DriverAttributes.DownloadURLAdmin
}
This returns the url of latest driver supported by your installed card, and may even return a Windows 7 driver if you run this on a Windows 7 machine with old card installed on it.