0

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.

hightest
  • 395
  • 5
  • 15

2 Answers2

0

I see Windows and Powershell tags in your question. This SuperUser post explains how to get this information, both using commandline and Powershell.

Dominique
  • 16,450
  • 15
  • 56
  • 112
0

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


Reference
DxTx
  • 3,049
  • 3
  • 23
  • 34