All,
So i'm pretty much there just missing a couple items. I want to specify a specific datastore and get the template names and their folder locations on the datastore.
I have this command and it gives me the HD info, but doesn't correlate to the VM name. How can i format this to get VM name matched with datastore location?
get-datacenter -name "Main Data Center 1" | get-datastore "templates_isos" | get-template |Get-HardDisk
It's there, look at the Parent property
get-datacenter -name "Main Data Center 1" | get-datastore "templates_isos" | get-template |Get-HardDisk | Select Name,Parent
In the default view you don't get to see all the preoperties that are there.
You can use the Get-Member cmdlet to see the available properties
get-datacenter -name "Main Data Center 1" | get-datastore "templates_isos" | get-template |Get-HardDisk | Get-Member
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It's there, look at the Parent property
get-datacenter -name "Main Data Center 1" | get-datastore "templates_isos" | get-template |Get-HardDisk | Select Name,Parent
In the default view you don't get to see all the preoperties that are there.
You can use the Get-Member cmdlet to see the available properties
get-datacenter -name "Main Data Center 1" | get-datastore "templates_isos" | get-template |Get-HardDisk | Get-Member
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I did the get-member but didn't notice parent! Luc always helpful in cleanin up my messes. Thanks again!
Here was my final command to get what i needed for anyone else intrested.
get-datacenter -name "Datacenter" | get-datastore "datastore" | get-template |Get-HardDisk | select Parent,Filename | Export-Csv -noTypeInformation folder_location.csv