none
Windows Update PowerShell Module Display Category With Get-WindowsUpdate aka Get-WUList Cmdlet? RRS feed

  • Question

  • I am trying to use this Powershell module to install Windows Updates from WSUS on a Windows Server 2016 machine:

    https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc

    Unfortunately I don't see a way to respond to the Q and A on the link above.

    My problem is I don't know how to view the category of each available update using the Get-WindowsUpdate aka Get-WUList cmdlet.

    Looking at the help I see:

    Get-Help Get-WindowsUpdate -Full
    
         -Category <String[]>
            Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...

    And an example on how to filter against Category:

    Get-Help Get-WindowsUpdate -Examples
    
    Get-WUList -NotCategory "Language packs"

    On my machine if I execute Get-WindowsUpdate I see:

    I don't want to be installing updates to SQL Server Management Studio, so I want to filter against its Category, but I'm unsure how to obtain its Category?

    Get-WindowsUpdate | Select-Object Title, @{L="Category";E={$_.Categories[0]|Select Name}}| Format-Table

    Executing this only shows me Categories with the definition "ICategoryCollection Categories () {get} "

    Get-WindowsUpdate | Get-Member * -Force

    Anyone else out there using the Windows Update PowerShell Module and know the answer?

    Thanks

    Stuart

    Sunday, August 9, 2020 11:45 PM

Answers

  • This seems to give me the Category so I can filter on it:

    Get-WindowsUpdate | Select-Object Title, @{L="Category";E={$_.Categories[0]|Select Name}}| Format-Table

    Get-WindowsUpdate -NotCategory "Microsoft SQL Server Management Studio v18"

    • Marked as answer by stuartfromnz Tuesday, August 11, 2020 2:29 AM
    Tuesday, August 11, 2020 2:29 AM

All replies

  • The Gallery has been discontinued and locked.

    The WIndowsUpdate module has been improved.  Do not use the script from the Gallery.

    You an get the latest version as follows:

    update-module pswindowsupdate


    \_(ツ)_/

    Monday, August 10, 2020 12:18 AM
  • Thanks jrv, I still can't work it out with the latest version. I've sent a message to the author, once I've worked it out I'll update this post.

    https://www.powershellgallery.com/packages/PSWindowsUpdate/2.2.0.2


    Monday, August 10, 2020 2:18 AM
  • What author?  The Gallery is closed and is in archive state.

    The link I posted is the help for the current version.  Beyond that we cannot guess at what you are asking.

    Start here:

    get-command get-windowsupdate -module pswindowsupdate   | help -full


    \_(ツ)_/


    • Edited by jrv Monday, August 10, 2020 3:08 AM
    Monday, August 10, 2020 3:02 AM
  • What author?  The Gallery is closed and is in archive state.

    The link I posted is the help for the current version.  Beyond that we cannot guess at what you are asking.

    Start here:

    get-command get-windowsupdate -module pswindowsupdate   | help -full


    \_(ツ)_/


    Author = Michal Gajda

    This website appears when running 

    get-command get-windowsupdate -module pswindowsupdate   | help -full

    Website = https://commandlinegeeks.wordpress.com/kontakt/


    Monday, August 10, 2020 4:36 AM
  • What author?  The Gallery is closed and is in archive state.

    The link I posted is the help for the current version.  Beyond that we cannot guess at what you are asking.

    Start here:

    get-command get-windowsupdate -module pswindowsupdate   | help -full


    \_(ツ)_/


    Author = Michal Gajda

    This website appears when running 

    get-command get-windowsupdate -module pswindowsupdate   | help -full

    Website = https://commandlinegeeks.wordpress.com/kontakt/

    Yes but the help is all you need to read to answer all of your questions.  I doubt Michal will answer questions that the help documents.  MG has many modules and scripts that are all mostly now in PowerShell Gallery.

    The question you are asking is fully answered in the help.


    \_(ツ)_/

    Monday, August 10, 2020 4:41 AM
  • I don't see the  Get-WindowsUpdate command that will give me the Category value for each available update. jrv you have helped me many times in the past any chance you could figure this out for me too? :)

    With this then I can use:

    Get-WindowsUpdate -NotCategory "ExampleValue"

    Monday, August 10, 2020 4:48 AM
  • Figure out what?  The help will tell you.  

    help Get-WindowsUpdate -par category

    I think I have mentioned this before but you need to learn how to use help.

    help help

    Read all of the instructions.


    \_(ツ)_/

    Monday, August 10, 2020 6:30 AM
  • Figure out what?  The help will tell you.  

    help Get-WindowsUpdate -par category

    I think I have mentioned this before but you need to learn how to use help.

    help help

    Read all of the instructions.


    \_(ツ)_/

    I don't have access to a machine with the latest version of the Windows Update Powershell Module at the moment, but I'm assuming that command gives a different output to what I put in my original post:

    -Category <String[]>
            Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...

    I want to see the category associated with KB4571789 "SQL Server Management Studio 18.6"

    Monday, August 10, 2020 9:52 PM
  • Sorry but you are not asking about a category.  You are asking about a KB so just use the KBID to retrieve the entry.


    \_(ツ)_/

    Tuesday, August 11, 2020 12:39 AM
  • I'm trying to automate the monthly installation of patches via a script.

    As a one off, I could filter against the KB number, but what happens when SQL Server Management Studio 18.7 is released. I don't want to have to manually intervene each time.

    FYI I do appreciate you replying to my posts.


    Tuesday, August 11, 2020 2:23 AM
  • This seems to give me the Category so I can filter on it:

    Get-WindowsUpdate | Select-Object Title, @{L="Category";E={$_.Categories[0]|Select Name}}| Format-Table

    Get-WindowsUpdate -NotCategory "Microsoft SQL Server Management Studio v18"

    • Marked as answer by stuartfromnz Tuesday, August 11, 2020 2:29 AM
    Tuesday, August 11, 2020 2:29 AM