Automation

 View Only
  • 1.  How to leave only two decimals in UsedSpaceGB value

    Posted May 01, 2013 08:51 PM

    Hello,

    I have the following instruction:

    get-vm server* | select name,UsedSpaceGB,VMhost,guest | ft -auto

    but the usedspace gb is like this 104.06407394539564847946166992

    How can i set it to 104.06 ?



  • 2.  RE: How to leave only two decimals in UsedSpaceGB value
    Best Answer

    Posted May 01, 2013 09:02 PM

    With the Round fucntion

    get-vm server* | 
    select name,@{N="UsedSpaceGB";E={[math]::Round($_.UsedSpaceGB,2)}},VMhost,guest | ft -auto