VMware Cloud Community
Naihan
Contributor
Contributor

Template Size

Hi

Dose anyone know how to find a vmtemplate size?

Naihan

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

Try something like this

Get-Template | Select Name,@{N="Size";E={($_.Extensiondata.layoutEx.File | Measure-Object -Property Size -Sum).Sum}}

The size is expressed in bytes, if you want KB, you can do.

Get-Template | Select Name,@{N="Size";E={($_.Extensiondata.layoutEx.File | Measure-Object -Property Size -Sum).Sum/1KB}}

You can replace the 1KB by 1MB or 1GB to get MB or GB respectively.

If you want the size nicely formatted you can do

Get-Template | Select Name,@{N="Size";E={"{0:f2}" -f (($_.Extensiondata.layoutEx.File | Measure-Object -Property Size -Sum).Sum/1KB)}}

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos