Get Directory Space Used

To get the amount of space a directory and its files use, use the Windows Scripting Host FileSystemObject

$objFSO = New-Object -com Scripting.FileSystemObject
(($objFSO.GetFolder("d:\powershell").Size) / 1MB).tostring() + " MB"