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()
%d bloggers like this: