PowerShell expressions and operators

Posted on 2011-04-23
Last Modified: 2012-08-13
I am trying to get this PowerShell command to function, but this is my first attempt using PowerShell and I am failing....

Using a command Get-WSUSUpdateClassifications | ? {$_.Title -eq "Critical Updates"}

That works and returns the list I am wanting.  But I would like it to also return anything that matches "Security Updates" and all the commands I have tried arent working.

For instance:
Get-WSUSUpdateClassifications | ? {$_.Title -eq "Critical Updates"} -OR {$_.Title -eq "Security Updates"}

Where-Object : A parameter cannot be found that matches parameter name 'OR'.
At line:1 char:72
+ Get-WSUSUpdateClassifications | ? {$_.Title -eq "Critical Updates"} -OR <<<<  {$_.Title -eq "Security Updates"}
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.WhereObjectCommand

Open in new window

Question by:floydianone
    1 Comment

    Accepted Solution

    ... and 5 more minutes of trying.. gave me the answer:

    Get-WSUSUpdateClassifications | ? {$_.Title -eq "Critical Updates" -OR $_.Title -eq "Security Updates"}

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now