VMware Cloud Community
drivera01
Enthusiast
Enthusiast

Round the answer for datastore size remaining (GB)



How can I round the data I get for this:


I get stuff like 765.67879879879


I rather just have 766


I know how to round using E={[math]::Round(....


but because of the join I used, I can not figure out how to do both,...


thank you

get-vm $vmlist | select Name, @{N="Datastore free space (GB)";E={[string]::Join(',',(Get-Datastore -Id ($_.DatastoreIdList) | Select -ExpandProperty

FreeSpaceGB))}}

Reply
0 Kudos
2 Replies
kunaludapi
Expert
Expert

get-vm | select Name, @{N="Datastore free space (GB)";E={[string]::Join(',',[math]::Round((Get-Datastore -Id ($_.DatastoreIdList)).FreeSpaceGB))}}

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
Reply
0 Kudos
drivera01
Enthusiast
Enthusiast


ahhh...ok...thank you very much

Reply
0 Kudos