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
No Comments