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.
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