is it possible to check free disk space in windows server

if the disk space is less than 2GB i need to call another powershell script.
Nandha Kumar BAsked:
Who is Participating?
 
oBdAConnect With a Mentor Commented:
If (((Get-WmiObject Win32_Volume -Filter "DriveLetter='C:'").FreeSpace / 1GB) -lt 2) {
	& "C:\Temp\Whatever.ps1"
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.