Shows free space on remote server partitions

PowerShell
Edit|Remove
$Server = Read-Host "Computer name"

$Disks = gwmi –computername $Server win32_logicaldisk -filter "drivetype=3"

	foreach ($Disk in $Disks) 
	{
		$Size = "Size {0:0.0} GB" -f ($Disk.Size/1GB)
		$FreeSpace = "Free Space {0:0.0} GB" -f ($Disk.FreeSpace/1GB)
		$Used = ([int64]$Disk.size - [int64]$Disk.freespace)
		$SpaceUsed = "Used {0:0.0} GB" -f ($Used/1GB)
		$Percent = ($Used * 100.0)/$Disk.Size
		$Percent = "{0:N0}" -f $Percent
	
			Write-Host ""
   			Write-host "Server Name : " $Server
   			write-host "Partition ID : " $Disk.deviceid 
   			write-host "Partition Name : " $Disk.volumename
   			write-host $Size
   			write-host $FreeSpace
   			write-host $SpaceUsed
   			write-host "Percentage used: " $Percent "%"
		
	}