PowerShell Script To Retrieve A Local Machines Available Free Disk Space In GB

 

This PowerShell script will return the logical C disk drive available free disk space in gigabytes.

 

PS1 Script:

 

$DiskDrive = GWMI -CL Win32_LogicalDisk |

 

Where {$_.DeviceId -Eq "C:"}

$DriveSpace = ($DiskDrive.FreeSpace /1GB)

 

Write-Host Available Free Disk Space = $DriveSpace GB

 

 

Published Sunday, January 20, 2008 8:36 AM by dhite
Filed under:

Comments

No Comments