I need a Powershell script that can get me total memory % from the Task Manager and get the output of it into a log file.
Thanks.
I need a Powershell script that can get me total memory % from the Task Manager and get the output of it into a log file.
Thanks.
I see Windows and Powershell tags in your question. This SuperUser post explains how to get this information, both using commandline and Powershell.
To get the total memory, try this command
(Get-WmiObject -class "cim_physicalmemory" | Measure-Object -Property Capacity -Sum).Sum
You can get this output into a text file using this command
(Get-WmiObject -class "cim_physicalmemory" | Measure-Object -Property Capacity -Sum).Sum | Out-File C:\logs.txt