Get-OSDriverPNPIDS.ps1

#Requires -RunAsAdministrator

<#
.LINK
    https://www.osdeploy.com/psmodule/osdrivers/
.SYNOPSIS
    Gets INF Information using Get-WindowsDriver
.DESCRIPTION
    Gets INF Information using Get-WindowsDriver
.PARAMETER Path
    Directory to search for INF files
.PARAMETER Files
    Files to Include. Default is *.inf
.EXAMPLE
    Get-OSDriverPNPIDS -Path C:\OSDrivers\Intel
    Gets information from *.inf files in C:\OSDrivers\Intel
.NOTES
    NAME: Get-OSDriverPNPIDS.ps1
    AUTHOR: David Segura, david@segura.org
    BLOG: http://www.osdeploy.com
    CREATED: 02/17/2018
    VERSION: 1.1.0.0
#>


function Get-OSDriverPNPIDS
{
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory=$True)]
        [string]$Path,
        [string]$Files = '*.inf',
        [switch]$FullDetails
    )
    
    #Find the INF Files
    $a = Get-ChildItem -Path "$Path" -Recurse -Include $Files -File | Select-Object -Property FullName
    
    #Create the Array
    $f = @()
    $p = @()
    
    #Loop through all of the INF Files
    ForEach ($i in $a) {
    
        #Progress
        Write-Host "Processing: " $i.FullName
        
        #Get the Driver Information
        $f += Get-WindowsDriver -Online -Driver $i.FullName | Select-Object HardwareId,HardwareDescription,Architecture,ProviderName,Version,Date,ClassName,BootCritical,DriverSignature,OriginalFileName
    }

    foreach ($i in $f) {
        $p += $i.HardwareId + " = " + $i.HardwareDescription
    }

    if ($FullDetails) {
        $f | Out-Gridview -Title 'Get-OSDriverPNPIDS Results:'
    } else {
        $p | Out-Gridview -Title 'Get-OSDriverPNPIDS Results:'
    }
}