header image

Windows Update: 5 drivers

Posted by: | June 18, 2011 | No Comment |

The previous posts just looked at installing software updates.  We can also get driver updates through Windows updates. A simple modification to the get-updates function sets this up.

function get-drivers {
param (

$session = New-Object -ComObject Microsoft.Update.Session
$searcher = $session.CreateUpdateSearcher()

# 0 = false & 1 = true
if ($hidden){
$result = $searcher.Search("IsInstalled=0 and Type=’Driver’ and ISHidden=1" )
else {
$result = $searcher.Search("IsInstalled=0 and Type=’Driver’ and ISHidden=0" )

if ($result.Updates.Count -gt 0){
$result.Updates |
select Title, IsHidden, IsDownloaded, IsMandatory,
IsUninstallable, RebootRequired, Description
else {
Write-Host " No updates available"


Discovers available driver updates

Interrogates Windows updates for available driver updates only.
Optional parameter to display hidden updates

.PARAMETER  hidden
A switch to display the hidden updates


Displays non-hidden updates

get-drivers -hidden

Displays hidden updates



We just change the type to Driver

I haven’t modified the install function but it is similar.



  1. This only displays drivers available through Windows Update
  2. It won’t pick up new drivers from the manufacturers site
  3. I would strongly recommend not installing new drivers automatically
under: PowerShellV2, Technology