Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Code Check for Disk Freespace

$
0
0

Hello, 

I have a very basic Powershell command string working, but when I execute it I get an error that says "Attempted to divide by zero".  When doing the math I am not attempting to divide by zero, so even though the commands work, I was wondering if anyone could explain to me why that error pops up. 

Thank you!

Get-WmiObject win32_logicaldisk | where-object {$_.Freespace -ge ((($_.freespace/$_.size) * 100)
) -and $_.drivetype -eq 3}


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>