Last active
February 13, 2023 20:11
-
-
Save ojmarcelino/0ac823adcd9820eddc2f43ef02176684 to your computer and use it in GitHub Desktop.
Updates drivers on Windows devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Session = New-Object -ComObject Microsoft.Update.Session | |
$Searcher = $Session.CreateUpdateSearcher() | |
$Searcher.ServiceID = '7971f918-a847-4430-9279-4a52d1efe18d' | |
$Searcher.SearchScope = 1 # MachineOnly | |
$Searcher.ServerSelection = 3 # Third Party | |
$Criteria = "IsInstalled=0 and Type='Driver'" | |
Write-Host('Searching Driver-Updates...') -Fore Green | |
$SearchResult = $Searcher.Search($Criteria) | |
$Updates = $SearchResult.Updates | |
#Show available Drivers... | |
$Updates | select Title, DriverModel, DriverVerDate, Driverclass, DriverManufacturer | fl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment