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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.