Search code examples
powershellwindows-10windows-update

Create a PowerShell Script to automatically scan for and hide certain Windows updates


As most of you know, Windows 10 automatically updates the device drivers and the video driver that is being installed by Microsoft is causing me some problems. To avoid this, I'm manually hiding the update using PowerShell.

For example, I use the below command to scan for check the status of the video driver.

Get-WUList | Where-Object {$_.Title -like '*Radeon*'}

If the update status is not hidden, then I will use the below command to hide the update.

Hide-WUUpdate -title "Title of the update"

But the problem is that after some time, Windows automatically changes the hidden status and tries to install the update. This is one thing I hate most in Windows 10 and it is really getting on my nerves.

Now what I want to know is that is there any easy way to create a PowerShell script that checks for the update on a daily basis or every time I start the system and then sets the status of the update to Hidden.


Solution

  • You could write the PowerShell script like this:

    $windowsUpdates = Get-WUList | Where-Object {$_.Title -like '*Radeon*'}
    for ($i = 0; $i -lt $windowsUpdates.Count; $i++ )
        { Hide-WUUpdate -Title $windowsUpdates[$i].Title }
    

    This will hide all updates that match your Title selection.

    Then schedule your PowerShell script in the Windows task scheduler. There you can choose at which frequency you run it. It is even possible to run it at system startup.