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

  • General discussion

  • 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?



    • Edited by Gextreme Friday, May 24, 2019 5:48 PM
    • Changed type Bill_Stewart Thursday, September 5, 2019 9:27 PM
    • Moved by Bill_Stewart Thursday, September 5, 2019 9:27 PM Abandoned
    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
  • Not better but different:

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


    Friday, May 24, 2019 6:08 PM