none
Remove header from output and filter to the left as much as possible RRS feed

  • Question

  • How can I run this command and only get the output without a header?

    Get-ADGroup -Filter {name -like "acl*full"} | select-object 'name'

    And is this the best way to run this cmdlet?  or is there a more productive way of running this in a way that will take less time.  I am trying to filter as much to the left as possible.

    I know I can do it like this:

    Get-ADGroup -Filter {name -like "acl*full"} | Select-Object -ExpandProperty name

    But is there a better way?

    Thanks,


    POWERSHELL


    • Edited by Gextreme Friday, May 24, 2019 5:48 PM
    Friday, May 24, 2019 5:45 PM

All replies

  • What you have written is one correct and very succinct way. What's wrong with it?


    -- Bill Stewart [Bill_Stewart]

    Friday, May 24, 2019 5:57 PM
    Moderator
  • Not better but different:

    (Get-ADGroup -Filter {name -like "acl*full"}).Name


    \_(ツ)_/

    Friday, May 24, 2019 6:08 PM