#Test-Debug.ps1 $computers = Get-Content c:\computers.txt $qty = $computers | Measure-Object Write-Debug "'$qty is $qty" $qty = $qty.count Write-Debug "'$qty is $qty" Write-Verbose "Inventorying $qty computers" foreach ($computer in $computers) { Write-Debug "'$computer is $computer" Write-Output 'n$computer Write-Verbose "Connecting..." $wmi = gwmi -query "select * from win32_logicaldisk where drivetype= -computer $computer $wmi | Measure-Object | write-debug Write-Verbose "Free space on local drives..." foreach ($drive in $wmi) { $device = $drive.deviceid Write-Debug "'$device is $device" $space = $drive.freespace / 1MB Write-Debug "'$space is $space" Write-Output "$device has $space MB free" } }