Is there a cmdlet that rounds numbers (all float values) in the output?
When I run the following command:
get-vm |select ProvisionedSpaceGB,UsedSpaceGB
I get this output as a table:
ProvisionedSpaceGB UsedSpaceGB
------------------ -----------
1224,0003194380551576614379883 349,88938544876873493194580078
1224,0003062393516302108764648 321,74483488313853740692138672
502,80292716529220342636108399 74,052481059916317462921142578
700,00035238638520240783691406 484,56624550372362136840820312
800,0003144945949316024780273 322,26342210918664932250976562
I know that I can determine what is in the cmdlet selectlike this:
get-vm | select @{ n="ProvisionedSpaceGB"; e={[math]::round( $_.ProvisionedSpaceGB, 2 )}},
@{ n="UsedSpaceGB"; e={[math]::round( $_.UsedSpaceGB, 2 )}}
And then get this output:
ProvisionedSpaceGB UsedSpaceGB
1224,00 349,58
1224,00 320,32
502,80 74,05
700,00 484,57
800,00 322,26
But there should be an easier way, for example, linking it to another cmdlet:
get-vm |select ProvisionedSpaceGB,UsedSpaceGB |RoundNumbers -Precision 2
To get the second conclusion.