Counting MS 2006 Drivers

Counting MS 2006 Drivers

Yesterday’s post about generic, MS-supplied device drivers got me thinking. These drivers bear an issue date of 6/21/2006, which coincides with Windows Vista’s RTM date. To be more specific, I wondered how many such items might appear in the Windows DriverStore. With counting MS 2006 drivers in mind, I asked Copilot for a PowerShell script to count them for me. Just for grins I compared that count to the total items as well.

Scripting Out Counting MS 2006 Drivers

You can see the results of my query to Copilot in the lead-in graphic. That query was “Write me a PowerShell script to display number of Windows drivers dated 6/21/2006 and total driver count.” As it turned out, on my Lenovo X380 ThinkPad running Windows 11, those numbers were 517 (2006 count) and 701 (total count). On my i7Skylake homebuilt system running Windows 10, those numbers were 511 and 672, respectively.

I’ll show the PowerShell commands below, but first I want to observe I had NO IDEA that MS supplies roughly 5 of every 7 drivers that Windows uses (over 70%). From looking at the items in the DriverStore more closely thanks to PowerShell, I see that this is because many of them are class, bus and service drivers. You can thus understand them as part of the driver stack between the OS and the function driver (at the bottom of the stack, it actually interacts with devices).

Here’s how MS shows this architecture in its MS Learn article “What is a driver?

Counting MS 2006 Drivers.diagram
The driver at the bottom of the stack that communicates with a device is a function driver; according to the MS Learn item, filter drivers do “auxiliary processing” which may involve monitoring, verifying, translating, or otherwise manipulating in- and out-bound stack communications. By convention app to device communication moves down the stack, while device to app communication goes the other way.

PowerShell Details

Here’s the PowerShell that Copilot handed to me in response to my query, including comments (start with a # character):

#Get all the drivers from the online Windows image
$drivers = Get-WindowsDriver -Online -All
# Filter the drivers by the date of June 21, 2006
$drivers_2006 = $drivers | Where-Object {$_.Date -eq "6/21/2006"}
# Count the number of drivers with that date
$drivers_2006_count = $drivers_2006.Count
# Display the number of drivers and their names
Write-Output "There are $drivers_2006_count drivers dated 6/21/2006 in the online Windows image."
Write-Output "The names of the drivers are:"
$drivers_2006 | ForEach-Object {Write-Output $_.OriginalFileName}
# Display the total number of drivers
$alld = $drivers | Where-Object {$_.Inbox -eq "True"}
Write-Output "There are $alld.count total Windows drivers in the online Windows image."

Some of the lines shown above break across two lines in the browser, but are actually single PowerShell commands. If you run them, you must put them on a single line. I just ran the commands in sequence, one at a time as you can see in the lead-in graphic. I cheated, though: I simply output $alld.count in the last line shown. The PowerShell shown above wraps this in some explanatory text.

Facebooklinkedin
Facebooklinkedin

Leave a Reply

Your email address will not be published. Required fields are marked *