Skip to content

Instantly share code, notes, and snippets.

@TScalzott
Created October 29, 2015 00:03
Show Gist options
  • Save TScalzott/c420a5f85bedb6bc5f4e to your computer and use it in GitHub Desktop.
Save TScalzott/c420a5f85bedb6bc5f4e to your computer and use it in GitHub Desktop.
Not-So-Elegant Template Info
$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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment