# encoding: ascii
# api: powershell
# title: df
# description: A simple df (disk free) function for PowerShell
# version: 0.1
# type: function
# license: CC0
# x-poshcode-id: 428
# x-archived: 2010-12-15T11:53:25
#
#
function df ( $Path ) {
	if ( !$Path ) { $Path = (Get-Location -PSProvider FileSystem).ProviderPath }
	$Drive = (Get-Item $Path).Root -replace "\\"
	$Output = Get-WmiObject -Query "select freespace from win32_logicaldisk where deviceid = `'$drive`'"
	Write-Output "$($Output.FreeSpace / 1mb) MB"
}
