I am having some problems writing to a text using the correct format. I am pulling some windows event logs and saving the output to a text file. When I issue the following 2 commands
$event = get-winevent -filterhashtable @{logname='ForwardedEvents'; id=4688} $event | format-list >> C:scriptsfile01.txt
I get something like this saved to the text file with a bunch of white space and the line broken up because it is too long:
New Process Name:
C:WindowsSystem32SearchFilterHost.exe
Is there anyway to make the output look like this instead:
New Process Name: C:WindowsSystem32SearchFilterHost.exe
thanks
