Similar keys of one cmdlet at one line

This topic contains 2 replies, has 2 voices, and was last updated by  Dmitry P 2 years, 8 months ago.

  • Author
  • #29759

    Dmitry P

    Hi. I need to select a PCs with Get-ADComputer, whose names beginning with N and W, so I tried this:
    Get-ADComputer -Filter {Name -like 'w*' or Name -like 'n*'}
    But I got syntax error. How exactly this command should be?

  • #29760

    Don Jones

    The OR operator is -or. It seems that you've typed "or" without the dash.

  • #29762

    Dmitry P

    Gods... such a newbie mistake. Thanks, Don!

You must be logged in to reply to this topic.