Hi,
I want to monitor CPU and RAM usage for 1 specific application and extract it to a txt file.
Using get-process gives me all the different values but I just want CPU value. Below is my script, when I tried $process.CPU, it does not give me the CPU usage and could someone shows me how to extract these information to a txt file?
Thanks
$Processes = get-process chrome | Group-Object -Property ProcessName
foreach($Process in $Processes)
{
$Obj = New-Object psobject
$Obj | Add-Member -MemberType NoteProperty -Name Name -Value $Process.Name
$Obj | Add-Member -MemberType NoteProperty -Name Mem -Value ($Process.Group|Measure-Object WorkingSet -Sum).Sum
$Obj | Add-Member -MemberType NoteProperty -Name CPU -Value $Process.CPU
$Obj
}