I would like to run a cmdlet and then filter the results in different ways. i.e., retrieve a bunch of events with Get-WinEvent(), then write 2 csv files with Export-Csv() - one with all of the events and one with just the events with 'Level' = 2 (Error). Is there a way to reference the results twice - once with a pipe and once separate from that pipe?
Sure. Just create the first file with all the events and use that file as input to filter on to create the second.
Sounds good. Thanks.