VMware Cloud Community
MRoushdy
Hot Shot
Hot Shot
Jump to solution

get-datastore where usedspaceGB is....

Hello,

I want a script that calculates the percentage of the used space pf a datastore and get me only the datastores that the UsedSoaceGB is greater than a specific percentage.

Thanks,

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Something like this?

$percent = 50

Get-Datastore |

where { ($_.CapacityGB - $_.FreeSpaceGB) / $_.CapacityGB * 100 -gt $percent } |

select Name

---------------------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Something like this?

$percent = 50

Get-Datastore |

where { ($_.CapacityGB - $_.FreeSpaceGB) / $_.CapacityGB * 100 -gt $percent } |

select Name

---------------------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


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

0 Kudos
MRoushdy
Hot Shot
Hot Shot
Jump to solution

Yeah I think so. Let me try it in the morning and let you know.

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
0 Kudos