PowerShell Log files

After executing your script you will like to save some of the outputs to a file. There is a simple way to do this in PowerShell.

“Hello” | out-file c:file.txt

Append test to an existing file

“Hello 2” | out-file c:file.txt -append

CSV Files

To create a comma separated value use the export-csv command. This example will create a csv file with all the process from the computer and sort them by CPU usage.

Get-Process | select name, cpu | sort cpu -Descending | Export-Csv c:file.csv -notypeinformation

Subscribe For Latest Updates

Sign up for best of digital marketing, livestream and technology opinions on what matters to you.

Invalid email address
We promise not to spam you. You can unsubscribe at any time.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: