May 072013
 

This PowerShell script uses Dism to find all OEM entries and then parses them into a text file. Run as administrator.

###########################################################################
#
# Get-Drivers.ps1
#
# Use Dism to create a list of OEM driver entries. This can also be 
# changed to output other entries as well. Run as administrator.
#
# by Robert Hollingshead
# Contributed to the public domain. Do with it what you will. 
#
###########################################################################

$fileStream = [System.IO.StreamWriter] "C:\Drivers.txt"

[array]$arrayDismParsed = @()

$arrayDismParsed = "Parsed output from Get-Drivers.ps1"

# Populate the array. 
$arrayDismOutput = & dism /online /get-drivers /all /format:table

$arrayDismParsed = $arrayDismParsed + $arrayDismOutput[11]
$arrayDismParsed = $arrayDismParsed + $arrayDismOutput[12]
$arrayDismParsed = $arrayDismParsed + $arrayDismOutput[13]

for ($arrayPos=0;$arrayPos -le $arrayDismOutput.length;$arrayPos++)
{
    if ($arrayDismOutput[$arrayPos] -like "*OEM*") # Find the OEM entries. ;
    {
        $arrayDismParsed = $arrayDismParsed + $arrayDismOutput[$arrayPos]
    }
}

for ($arrayPos=0;$arrayPos -le $arrayDismParsed.length;$arrayPos++)
{
    $fileStream.WriteLine($arrayDismParsed[$arrayPos])
}

$fileStream.Close()
May 072013
 

The following PowerShell script will delete drivers from the driver store that match a keyword. It will also ignore a specific driver if need be. Use to prune older sets of drivers that are no longer needed. Use at your own risk, of course.

###########################################################################
#
# Use pnputil to delete drivers (in this case Xerox) from the driver store. 
#
# by Robert Hollingshead
# Contributed to the public domain. Do with it what you will. 
#
###########################################################################

# Populate the array. 
$arrayPnpOutput = & pnputil -e

for ($arrayPos=0;$arrayPos -le $arrayPnpOutput.length;$arrayPos++)
{
    if ($arrayPnpOutput[$arrayPos] -like "*Xerox") # Find matches for xerox as the publisher. ;
    {
        if ($arrayPnpOutput[$arrayPos+2] -notlike "*11/23/2011 5246.700*") # Do not kill this version..
        {
            $arrayPnpOutput[$arrayPos-1] = $arrayPnpOutput[$arrayPos-1] -replace "Published name :            ",""
            Write-Host "Erasing: " $arrayPnpOutput[$arrayPos-1]
            pnputil -d $arrayPnpOutput[$arrayPos-1]
        }
    }
}