A simple PackageManagement (aka Oneget) Provider for Windows Update

One of the breaking changes that comes along with PowerShell 5.0 is OneGet PackageManagement.
What is OneGet? Oneget is a package providers source aggregator, a unified package management tool like APT is on Linux.

When I said like Linux, I also meant it’s open-source 😀 and that you can actually write your own provider. The list of desired package providers is listed on this page.

To get a better understanding of what OneGet PackageManagement is, I’d recommend you read these two posts:

To get my hands-on this new tool on Christmas holidays, I wrote a prototype for the Windows Update Agent (WUA) provider that can query dynamically updates from locally registered sources: Windows Update (by default), Microsoft Update (after opt-in), WSUS, the Windows Store,… Unfortunately, I can’t present this code as it’s too clunky with the latest PackageManagements builds over the last 6 months. To get things working smoothly, I revised the code and tried to keep it simple. This post will present a Windows Update Agent provider that exclusively queries only 1 source: Windows Update. It could probably meet the following expectations recently reported on MS connect website:

Let’s see how this provider works:

  • List package providers and sources available on the box
  • WUA-01

  • List what was installed from Windows Update on the box
  • Get-Package -ProviderName WUA


  • Install missing updates from Windows Update
  • Find-Package -Source  'Windows Update' | Install-Package


Bonus: To be able to see what happens behind the scene and be able to choose and confirm the updates you want to install, you can do:

Find-Package -Source  'Windows Update' -Debug | 
Install-Package -Debug

I’ve hosted the Windows Update Agent provider for Windows Update on github using this link: https://github.com/p0w3rsh3ll/OneGetWUAProvider

By the way, I’m not the only one who writes PackageManagement providers using PowerShell.
Windows PowerShell MVP Doug Finke already wrote two providers for gist and github that inspired me and helped me while working on mine 😀

1 thought on “A simple PackageManagement (aka Oneget) Provider for Windows Update

  1. Pingback: Dew Drop – June 3, 2015 (#2027) | Morning Dew

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.