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, 1 month ago.

  • Author
    Posts
  • #29759

    Dmitry P
    Participant

    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
    Keymaster

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

  • #29762

    Dmitry P
    Participant

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

You must be logged in to reply to this topic.