Can't filter out column when that column is used by -groupby

This topic contains 2 replies, has 2 voices, and was last updated by  Poseyj 2 years, 9 months ago.

  • Author
  • #28934


    Here is my elaborate program:

    get-eventlog -LogName Application -Newest 5 | Format-Table -GroupBy Source

    My goal is to GroupBy Source, but not SHOW source columns in each group because its redundant information. Now I'm aware of select-object and -excludeproperty but it doesn't seem to work unless I manually specify the columns to select first. If I do that, then when it pipes to format-table from Select, 'Source' no longer exists and therefore cannot be grouped anymore. Is there a way to do this? I basically want to group by a property but not show that property

  • #28943

    Max Kozlov

    get-eventlog -LogName Application -Newest 5 | Format-Table -GroupBy Source -Property Index, Time, EntryType, InstanceID, Message

  • #28960


    Shoot, that was easy. thanks

You must be logged in to reply to this topic.