exporting command output to a csv file
get-process | sort-object -property ws -descending | select-object -property processname,ws -first 5|Export-csv /home/sourav/Desktop/top5proc.csv
to see the content of the csv
Get-Content ./Desktop/top5proc.csv
to impoer the csv file
import-csv ./Desktop/top5proc.csv
if there are lots of data in the csv file we can format the output which will produce data in a more readable format
import-csv ./Desktop/top5proc.csv|Format-Table
get-process | sort-object -property ws -descending | select-object -property processname,ws -first 5|Export-csv /home/sourav/Desktop/top5proc.csv
to see the content of the csv
Get-Content ./Desktop/top5proc.csv
to impoer the csv file
import-csv ./Desktop/top5proc.csv
if there are lots of data in the csv file we can format the output which will produce data in a more readable format
import-csv ./Desktop/top5proc.csv|Format-Table
No comments:
Post a Comment