With commands powercli, how find the esx of the Template, without change the Template to(in) vm?
thanks you for your help
Get-template | select Name,@{Name="Host";Expression={(get-view $_.HostId).Name}}
Get-template | select Name,@{Name="Host";Expression={(get-view $_.HostId).Name}}
How about this?
$Templates = @()
$Hosts = Get-VMHost
foreach ($h in $hosts) {
$HostTemplates = Get-Template -Location $h
foreach ($t in $HostTemplates) {
$TemplateInfo = New-Object PSObject
$TemplateInfo | Add-Member -MemberType NoteProperty Name -Value $t.Name
$TemplateInfo | Add-Member -MemberType NoteProperty Host -Value $h.Name
$Templates += $TemplateInfo
}
}
$Templates
That's certainly much more elegant. I need to learn how to use Get-View!
it's ok for me
thank for your response