Similar keys of one cmdlet at one line

Welcome Forums General PowerShell Q&A Similar keys of one cmdlet at one line

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
3 years, 7 months ago.

  • Author
    Posts
  • #29759

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

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

  • #29762

    Participant
    Points: 0
    Rank: Member

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

The topic ‘Similar keys of one cmdlet at one line’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort