Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How can I check if system drive has less than 5GB using Powershell and WMI?

$
0
0

I need a Powershell and WMI query that will do the following:

  1. Doesn't assume that SystemDrive is C: (this needs to run on hundreds of machines and windows may not be on C)
  2. Checks if there is less than 5GB left on that drive
  3. Must be done in a Select query only in the form below
    1. Get-WmiObject -Query "Select * From Win32...."

Basically I want to check that the system drive on many computers have enough space left before I apply an update but I have to work with the constraints above.

 

Cheers!


Viewing all articles
Browse latest Browse all 6937

Trending Articles