I am looking for some guidance, I am not sure how to tackle this, I want to get a list of all my VMs in one of my vCenters but I want to exclude the templates from that list. Can anyone help point me in the right direction?
The Get-VM cmdlet does not return Templates.If you are using Get-View, you can use the Filter parameter
Get-View -ViewType VirtualMachine -Filter @{'Config.Template' = 'false'} | Select Name
Duh... Yes you're right and I am an idiot. To that line can I add, get powered off VMs only?
Sure, you can multiple conditions to the filter.Just note that it is an AND between all these conditions.
Get-View -ViewType VirtualMachine -Filter @{'Config.Template' = 'false';'Runtime.PowerState' = 'poweredOff'} | Select Name