VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

get-datastore naaid + freespace + capacitygb

rying to get my datastore info and naaid plus freesapce and capacity gb

but I am not sure how to round off the freespacegb

get-datastore -server vc | select Name, @{N="naaid";E={$_.extensiondata.info.vmfs.extent.diskname}{, FreespaceGb, capaictyGB

Freespacegb is showing like this 4092.6474609375

i want to round it off to 4092.64

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Datastore -Server vc |

select Name,

    @{N="naaid";E={$_.extensiondata.info.vmfs.extent.diskname}},

    @{N='FreespaceGb';E={[math]::Round($_.FreespaceGB,2)}},

    @{N='CapacityGB';E={[math]::Round($_.CapacityGB,2)}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Datastore -Server vc |

select Name,

    @{N="naaid";E={$_.extensiondata.info.vmfs.extent.diskname}},

    @{N='FreespaceGb';E={[math]::Round($_.FreespaceGB,2)}},

    @{N='CapacityGB';E={[math]::Round($_.CapacityGB,2)}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

thanks

Reply
0 Kudos