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
  • 29
  • 9

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
  • 13,061
  • 14
  • 45
  • 83
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
  • 2,724
  • 2
  • 19
  • 32