Listing Of Drivers, Versions, & MFRs

Discussion in 'Scripting' started by DeathStalker77, Aug 27, 2023.

  1. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    I would know how to Out-String sorry.;)
     
  2. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    #22 Ace2, Aug 29, 2023
    Last edited: Aug 29, 2023
    Code:
    }) | Sort-Object Manufacturer, Driver, Version, Name -Unique | Format-Table -AutoSize > Drivers.txt
    
    Pause
    OR
    Code:
    }) | Sort-Object Manufacturer, Driver, Version, Name -Unique | Add-Content Driver.txt
    
    Pause
    This work for me, run .ps1 from desktop, as running from C:\ give out-file : Access to the path 'C:\Drivers.txt' is denied.;)
     
  3. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,924
    150
    If you keep the UAC enabled this is pretty normal, since the vista days.
     
  4. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    #24 Ace2, Aug 29, 2023
    Last edited: Aug 29, 2023
    Manufacturer Fixed.;)
    Code:
    @(Get-WmiObject Win32_SystemDriver | Where-Object { $_.DisplayName -ne $null } |% {
        [PSCustomObject]@{
            Manufacturer = 'Microsoft'
                  Driver = ($_.PathName -split '\\')[-1]
                 Version = ((Get-Item $_.PathName).VersionInfo.FileVersion -replace '^ ' -split ' ')[0]
                    Name = $_.DisplayName
        }
    }
    
    Get-WmiObject Win32_PnPSignedDriver | Where-Object { $_.FriendlyName -ne $null } |% {
        [PSCustomObject]@{
            Manufacturer = $(if ($_.Manufacturer -notmatch 'Microsoft|Generic|\(') { $_.Manufacturer } else { $_.DriverProviderName })
                  Driver = $_.InfName
                 Version = $_.DriverVersion
                    Name = $_.FriendlyName
         }
    }) | Sort-Object Manufacturer, Driver, Version, Name -Unique | Format-Table -AutoSize
    
    Pause
    OR

    Code:
    @(Get-WmiObject Win32_SystemDriver | Where-Object { $_.DisplayName -ne $null } |% {
        [PSCustomObject]@{
            Manufacturer = 'Microsoft'
                  Driver = ($_.PathName -split '\\')[-1]
                 Version = ((Get-Item $_.PathName).VersionInfo.FileVersion -replace '^ ' -split ' ')[0]
                    Name = $_.DisplayName
        }
    }
    
    Get-WmiObject Win32_PnPSignedDriver | Where-Object { $_.FriendlyName -ne $null } |% {
        [PSCustomObject]@{
            Manufacturer = $(if ($_.Manufacturer -notmatch 'Microsoft|Generic|\(') { $_.Manufacturer } else { $_.DriverProviderName })
                  Driver = $_.InfName
                 Version = $_.DriverVersion
                    Name = $_.FriendlyName
         }
    }) | Sort-Object Manufacturer, Driver, Version, Name -Unique | Add-Content Driver.txt
    
    Pause
     
  5. DeathStalker77

    DeathStalker77 MDL Addicted

    Nov 8, 2009
    580
    43
    30
    #25 DeathStalker77, Aug 29, 2023
    Last edited: Aug 29, 2023
    (OP)
    The latter works - the Driver.txt does not.

    I made a slight change to the SORT ---- Sort-Object Name, Manufacturer, Driver, Version | Format-Table -AutoSize

    This is fine, however, it seems to be lacking at least some of the drivers - ex, in Device Mgr I have (under SYSTEM DEVICES) -
    AMDA00 Interface
    Manufacturer (also Driver Provider): ASUSTeK Computer Inc.
    v1.0.1.0

    Same for
    ACPI Fixed Feature Button
    MS v10.0.19041.1202

    This ITEM (not just the MFR) does not show in the results at all! Looking at a few more, it seems to be based on the DEVICE DESCRIPTION or the DRIVER DECRIPTION (which seem to be usually the same) - could we add BOTH those fields in and confirm that?

    Thanks!!!

    --- DS
     
  6. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    One-liner
    Code:
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | Format-Table -AutoSize
     
  7. haber123

    haber123 MDL Member

    Nov 5, 2009
    100
    44
    10
    How can I ad a redirector to file like >c:\driver.txt?
     
  8. haber123

    haber123 MDL Member

    Nov 5, 2009
    100
    44
    10
    The one line redirect works, thank you.
     
  9. DeathStalker77

    DeathStalker77 MDL Addicted

    Nov 8, 2009
    580
    43
    30
    #29 DeathStalker77, Aug 30, 2023
    Last edited: Aug 30, 2023
    (OP)
    Ok, so this is almost working! SO close! What is happening with items like -
    ACPI Fixed Feature Button is that the MFR is listed as (Standard system devices) - which is NOT what I want - the Driver PROVIDER is Microsoft. However, when I try to substitute Provider, I get NOTHING returned :confused:

    Example: Get-WmiObject Win32_PnPSignedDriver | Select Provider, Description, DriverVersion | Sort Description, Provider, DriverVersion | Format-Table -AutoSize (you have to have your PowerShell Window set to a width of ~225, with your original code)

    --- DS
    (I feel like I'm going somewhat insane with this ...... )

    And yes :), re-directing it out like that works nicely too!
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, Description, DriverVersion | Sort Description, Manufacturer, DriverVersion | Format-Table -AutoSize >C:\drivers.txt

    Also, DisplayNme does not return ANY values either - even though values are displayed in the Properties ......
     
  10. haber123

    haber123 MDL Member

    Nov 5, 2009
    100
    44
    10
    In the future as this develops, wouldn't it be nice from the the yet to be added menu of options, a list of depreciated drivers.
     
  11. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    583
    992
    30
    @Ace2 what should it be to list the 3rd party drivers only?:g:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    Code:
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.Manufacturer -match "Intel" } | Format-Table -AutoSize
    
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.Manufacturer -match "Realtek" } | Format-Table -AutoSize
    Code:
    Windows PowerShell
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
    
    PS C:\Windows\system32> Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.Manufacturer -match "Intel" } | Format-Table -AutoSize
    
    Manufacturer         InfName     DriverVersion Description
    ------------         -------     ------------- -----------
    Intel                cpu.inf     10.0.20348.1  Intel Processor
    Intel                cpu.inf     10.0.20348.1  Intel Processor
    Intel                machine.inf 10.0.20348.1  Legacy device
    Intel(R) Corporation oem3.inf    6.16.0.3208   Intel(R) Display Audio
    Intel                oem5.inf    2.0.0.1094    Intel(R) Trusted Execution Engine Interface
    Intel Corporation    oem4.inf    20.19.15.5171 Intel(R) HD Graphics
    
    
    PS C:\Windows\system32> Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.Manufacturer -match "Realtek" } | Format-Table -AutoSize
    
    Manufacturer                InfName   DriverVersion    Description
    ------------                -------   -------------    -----------
    Realtek                     oem12.inf 10.65.421.2023   Realtek PCIe FE Family Controller
    Realtek                     oem18.inf 6.0.9273.1       Realtek High Definition Audio
    Realtek                     oem17.inf 10.0.22000.20284 EasyCamera
    Realtek Semiconductor Corp. oem13.inf 10.0.22621.31279 Realtek USB 2.0 Card Reader
     
  13. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,881
    2,123
    60
    Code:
    PS C:\Windows\system32> Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.Manufacturer -match "Intel" } | Format-Table -AutoSize
    
    Manufacturer         InfName      DriverVersion   Description
    ------------         -------      -------------   -----------
    Intel Corporation    intelpep.inf 10.0.19041.1266 Intel(R) Power Engine Plug-in
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel                cpu.inf      10.0.19041.2728 Intel Processor
    Intel Corporation    oem14.inf    30.100.2132.2   Intel(R) Serial IO GPIO Host Controller - INT3450
    Intel                oem61.inf    12.19.2.55      Intel(R) Ethernet Connection (7) I219-V
    INTEL                oem3.inf     10.1.16.8       Intel(R) SPI (flash) Controller - A324
    Intel(R) Corporation oem25.inf    10.27.0.12      Intel(R) Display-Audio
    INTEL                oem19.inf    10.1.1.36       CannonLake LPC Controller/eSPI Controller - A305
    INTEL                oem19.inf    10.1.1.36       CannonLake PCI Express Root Port #9 - A330
    INTEL                oem19.inf    10.1.1.36       CannonLake PCI Express Root Port #1 - A338
    INTEL                oem19.inf    10.1.1.36       CannonLake PCI Express Root Port #17 - A340
    Intel Corporation    oem31.inf    17.11.0.1000    Intel(R) 300 Series Chipset Family SATA AHCI Controller
    Intel                oem58.inf    2130.1.15.0     Intel(R) Management Engine WMI Provider
    Intel                oem33.inf    1.63.1155.1     Intel(R) iCLS Client
    Intel                oem0.inf     1.41.2021.121   Intel(R) Dynamic Application Loader Host Interface
    Intel                oem65.inf    2306.4.3.0      Intel(R) Management Engine Interface #1
    Intel Corporation    oem71.inf    31.0.101.2125   Intel(R) Graphics Command Center
    Intel Corporation    oem70.inf    31.0.101.2125   Intel(R) Graphics Control Panel
    Intel Corporation    oem63.inf    31.0.101.2125   Intel(R) UHD Graphics 630
    
    
     
  14. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    583
    992
    30
    Did a little bit change to actual code:p
    Code:
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { $_.InfName -match "oem" } | Format-Table -AutoSize
    
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    That's the best code so far.:cool:
     
  16. haber123

    haber123 MDL Member

    Nov 5, 2009
    100
    44
    10
    IS there a wild card to replace oem?
     
  17. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,889
    1,562
    60
    Don't know, maybe
    Code:
    Get-WmiObject Win32_PnPSignedDriver | Select Manufacturer, InfName, DriverVersion, Description | ? { "InfName like '%oem%'" } | Format-Table -AutoSize