none
PowerShell Display Title Of WSUS Updates RRS feed

  • Question

  • I am looking to publish to the application support teams in our company a list of the WSUS updates that I am about to push out to their servers. This is the script I have so far, it lists the Critical updates only:

    $ListOfUpdates = Get-WSUSUpdate -Classification Critical
    $ListOfUpdates


    How do I display the Title property only for each update? I've tried a ForEach loop and tried to get $ListOfUpdate.Title, but that shows no results.

    Thank you for any help.

    Wednesday, October 29, 2014 2:25 AM

Answers

All replies

  • Hi,

    Try piping through Select-Object:


    $ListOfObjects | Select -ExpandProperty Title

    Syntax:

    http://ss64.com/ps/select-object.html


    Don't retire TechNet! - (Don't give up yet - 13,085+ strong and growing)

    Wednesday, October 29, 2014 3:17 AM
  • Hi,

    Try piping through Select-Object:


    $ListOfObjects | Select -ExpandProperty Title

    Syntax:

    http://ss64.com/ps/select-object.html


    Don't retire TechNet! - (Don't give up yet - 13,085+ strong and growing)


    Thanks for replying, but what I get is an error: "Select : Property "Title" cannot be found.

    $ListOfUpdates = Get-WSUSUpdate -Classification Critical
    
    $ListOfUpdates | Select -ExpandProperty Title


    I've tried "| Select-Object -Property Approved" and that has shown the list of entries. Is there something that "Title" would be called different, even though it displays the results with that as the field name?
    Wednesday, October 29, 2014 4:05 AM
  • Hi,

    Try piping through Select-Object:


    $ListOfObjects | Select -ExpandProperty Title

    Syntax:

    http://ss64.com/ps/select-object.html


    Don't retire TechNet! - (Don't give up yet - 13,085+ strong and growing)


    I've tried a Property with * in the results, and get this:

    Update                             : Microsoft.UpdateServices.Internal.BaseApi.Update
    Classification                     : Critical Updates
    InstalledOrNotApplicablePercentage : 100
    Approved                           : NotApproved
    ComputersWithErrors                : 0
    ComputersNeedingThisUpdate         : 0
    ComputersInstalledOrNotApplicable  : 3
    ComputersWithNoStatus              : 0
    MsrcNumbers                        : {}
    Removable                          : False
    RestartBehavior                    : Never restarts
    MayRequestUserInput                : False
    MustBeInstalledExclusively         : False
    LicenseAgreement                   : This update does not have Microsoft Software License Terms.
    Products                           : {Windows 8.1, Windows 8, Windows Server 2012 R2, Windows Server 2012}
    UpdatesSupersedingThisUpdate       : {None}
    UpdatesSupersededByThisUpdate      : {None}
    LanguagesSupported                 : {all}
    UpdateId                           : e81faa96-a4b2-40a2-a6b1-f18564acd1f8
    I take it the "UpdateId" is the field I am after, but why isn't there an entry that is the same as the "Title" field that is displayed on the original search?
    Wednesday, October 29, 2014 7:57 AM
  • After a couple of hours playing, and starting from scratch, here is the code I have that does what I need:

    [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    
    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(“wsus”,$False,8530)
    
    $wsus.GetUpdates() | Where-Object {$_.UpdateClassificationTitle -eq 'Critical Updates'} | Select-Object -Property Title

    A huge thank you for everyone's help. I'm not sure why the other method didn't show the 'Title' return value...






    Wednesday, October 29, 2014 9:49 AM
  • Cheers Scott, I'm glad you were able to get what you needed.

    I haven't actually used any of the WSUS cmdlets, so I just took a guess based on your question.


    Don't retire TechNet! - (Don't give up yet - 13,085+ strong and growing)

    Wednesday, October 29, 2014 12:26 PM
  • $listofupdates.Update.Title 
    Wednesday, August 15, 2018 2:36 PM