Hi all,
I have the below script to get templates that recides in a specific datastore:
get-template -Location $vmhost | where-object{$_.extensiondata.config.files.VmPathName -like "*test_datastore1*"} | select name,
@{n='VMHOST';e={$vmhost.name}},
@{n='DS';e={$_.extensiondata.config.files.VmPathName.Split('[')[1].Split(']')[0]}}
how can I also get the entire size of the templates in GB?
Try something like this
@{n='VMHOST';e={$vmhost.name}},
@{n='DS';e={$_.extensiondata.config.files.VmPathName.Split('[')[1].Split(']')[0]}},
@{N='Storage';E={[math]::Round($_.ExtensionData.Summary.Storage.Committed/1GB,2)}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
well already found this from 2010 by Lucd it works fine
Try something like this
@{n='VMHOST';e={$vmhost.name}},
@{n='DS';e={$_.extensiondata.config.files.VmPathName.Split('[')[1].Split(']')[0]}},
@{N='Storage';E={[math]::Round($_.ExtensionData.Summary.Storage.Committed/1GB,2)}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you sir LucD