Wednesday, June 3, 2015

#79 : Find Free Memory Status on a Computer

Today's tip is about getting the free space in memory on a computer. This can easily done with WMI. Let's take a look in a one-liner.

Get-WmiObject win32_operatingsystem  | select csname, FreePhysicalMemory, FreeSpaceInPagingFiles, FreeVirtualMemory

This can play a good role when you are writing a script which might consume too much of memory, you can plan the execution when memory usage is normal.

Enjoy!

No comments:

Post a Comment

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...