The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,470 other followers

Regularly forcing Microsoft Silverlight to be a hidden Windows Update

Posted by jpluimers on 2017/01/03

I got a bit fed-up with the deprecated Microsoft Silverlight reappearing as KB3056819 in each Windows Update within minutes of hiding it (I’m not alone on this, it does this when you have configured to favour the Microsoft Update Servers – that also update Office – in favour of the Windows Update Servers).

Two really odd things:

  1. In the past, I hid “Skype for Windows desktop 7.3 (KB2876229)” which stayed hidden.
  2. I never installed Silverlight, there is no Silverlight on the system (I checked the registry, file system with Everything and more), but the update keeps re-appearing (like KB960353 does for others).

So I wanted a script that every minute could check for a Microsoft Silverlight update, then hide it.

That appeared a lot more cumbersome than I anticipated, hence this blog post.

The reason is that unlike many other operating systems, Windows does not come with a build-in package manager that you can script (there is Windows Installer, but is’s not easily scriptable).

The tries

I first tried to find a WMIC (the command-line to Windows Management Instrumentation) method for hiding an update. I could not find it.

Then I learned about PSWindowsUpdate which is a PowerShell Module containing a Hide-WUUpdate function which can hide Windows Updates.

Well, installing modules is a pain as installing them by hand is cumbersome (some sites even advice to run PowerShell in unrestricted mode) and there is no sanctioned module repository.

There is PSGet.net, but it has a very limited Directory of modules, no sanctioning and lures you into executing a textual download script (it says https://github.com/psget/psget/blob/master/GetPsGet.ps1) via redirection and the https version of the site has a wrong security certificate. So PSGet is out.

Then there is PowerShellGallery.com, which has a valid https certificate, a recent version os PSWindowsUpdate, but does have no sanctioning (only limited preview, heck even the site – though from Microsoft – is preview) and cumbersome to get started with: you need Windows 10, or one of to previews (Windows Management Framework 5.0 Production Preview or Source: Download PackageManagement PowerShell Modules Preview). So PowerShellGallery is out too.

Then there is the officially sanctioned Microsoft Technet gallery which is also not sanctioned and has an old version of PSWindowsUpdate. So the Technet gallery is out.

Finally there is Chocolatey.org, which has a valid https certificate, has a large review backlog, isn’t officially sanctioned either and too has an old version of PSWindowsUpdate (but more recent than the Technet gallery). So Chocolatey is out as well.

The solution

The solution is in PowerShell Magazine » How to view and restore hidden Windows Updates with PowerShell: some very small scripts that allow you to view Windows Update entries and hide/unhide them.

Two important notes:

  1. The script is really slow (it can take minutes on a system having many updates), but it works.
  2. It takes a while for the script to notice

Get-WindowsUpdate | Where { $_.Title -match 'Microsoft Silverlight (KB3080333)'} | Set-WindowsHiddenUpdate -Hide $true -Verbose

Note: You need to run this under an UAC Admin token.

–jeroen

PS: if you ever want to get started with PSWindowsUpdate, then read Manage Windows Update with PowerShell.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: