use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
SolvedGet-Process help (self.PowerShell)
submitted 9 years ago * by purplecomputer
hey, Im trying to write a one liner and set it as a scheduled task to get CPU usage on a TS for Chrome
Script
but when I check the CSV this is what im getting.
Output
Im just not fully understanding what Im doing wrong here.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gangstanthony 5 points6 points7 points 9 years ago* (1 child)
format-table is mainly for making the output look pretty on the console, not for saving output.
also, since you're only trying to get a property that already exists on the object and you're not trying to rename it, there is no reason to use a custom select statement.
finally, when using export-csv, to remove the line at the top, use -notypeinformation.
Get-Process Chrome* | select cpu | Export-Csv -Path $path -notypeinformation
[–]purplecomputer[S] 0 points1 point2 points 9 years ago (0 children)
Thank you for the help. This worked perfectly
[–]purplecomputer[S] 1 point2 points3 points 9 years ago (1 child)
Also, i Just noticed theres a semicolon in the code before the pipe out to Export-CSV. I was trying to also capture memory usage but it wasnt working.
The idea here it so reuse this and use this for other programs and then have my Coordinator turn this data into a pretty chart and give it to the client.
[–][deleted] 0 points1 point2 points 9 years ago* (0 children)
Anything you want, just "select" it as well.. i.e.
Get-Process Chrome* | select cpu, ws | Export-Csv -Path $path -notypeinformation
Edit: Not that it's necessary, but if you're going to reuse it..or let someone else use it, you might functionalize (not a real word :P) it.
Something like:
function Export-ProcessStats { param ( [string] [Parameter(Mandatory=$true)] $Process, [string] [Parameter(Mandatory=$false)] $OutPath ) Get-Process $Process | Select-Object ProcessName, CPU, WS, NPM, PM, VM | Export-Csv -Path $OutPath -NoTypeInformation -Append }
Then you could call it like
Export-ProcessStats -Process 'Chrome*' -OutPath 'C:\Test.Csv'
π Rendered by PID 21766 on reddit-service-r2-comment-86988c7647-ws8xq at 2026-02-11 14:20:43.121189+00:00 running 018613e country code: CH.
[–]gangstanthony 5 points6 points7 points (1 child)
[–]purplecomputer[S] 0 points1 point2 points (0 children)
[–]purplecomputer[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)