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