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 Profile photo of Poseyj Poseyj 1 year, 4 months ago.

  • Author
    Posts
  • #28934
    Profile photo of Poseyj
    Poseyj
    Participant

    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
    Profile photo of Max Kozlov
    Max Kozlov
    Participant

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

  • #28960
    Profile photo of Poseyj
    Poseyj
    Participant

    Shoot, that was easy. thanks

You must be logged in to reply to this topic.