⚡ PowerShell 5.1+

Get System Drivers Report

Queries Win32_SystemDriver via WMI and reports System Drivers in a formatted table, with an optional CSV export.

By WindowsScripting.com · 924 B
Get-SystemDriverReport.ps1
<#
.SYNOPSIS
    Reports System Drivers on this computer via WMI (Win32_SystemDriver).

.DESCRIPTION
    Queries Win32_SystemDriver and displays Name, DisplayName, State, PathName for each item found.
    Use -ExportPath to also save the results to a CSV file.

.PARAMETER ExportPath
    Optional path to a .csv file to write the results to.

.EXAMPLE
    .\Get-SystemDriverReport.ps1

.EXAMPLE
    .\Get-SystemDriverReport.ps1 -ExportPath C:\Reports\systemdriver.csv
#>

[CmdletBinding()]
param(
    [string]$ExportPath
)

$items = Get-CimInstance -ClassName Win32_SystemDriver | Select-Object Name, DisplayName, State, PathName

if (-not $items) {
    Write-Host "No System Drivers found." -ForegroundColor Yellow
    return
}

$items | Format-Table -AutoSize

if ($ExportPath) {
    $items | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
    Write-Host "`nExported to $ExportPath" -ForegroundColor Cyan
}