So I've got the percent free data with the VIProperty module but I'm running into an issue when just trying to find datastores with less than 20%. It seems to only be comparing the first number of PercentFree so it's missing a datastore that has 5.86% free. I'm drawing a blank on a better way to compare these two values?
$datastores = Get-Datastore
$datastores | where { $_.Name -notlike "Local*" -and $_.PercentFree -lt 20 } | sort Name | select Name, PercentFree
Results...
Name PercentFree
---- -----------
Datastore01 0.02 %
Datatsore02 19.24 %