PowerCLI-Example-Scripts icon indicating copy to clipboard operation
PowerCLI-Example-Scripts copied to clipboard

VmTemplate_List error

Open Sgwalker1969 opened this issue 5 years ago • 2 comments

Hi, I'm trying to retrieve vmtemplateid to pass to SetHVPool cmdlet; I use the following code:

$vCenterID=$(Get-HVvCenterServer).id $vTemplateSvc= New-Object VMware-Hv.VmTemplateService $vTemplateList= $vTemplateSvc.VmTemplate_List($vCenterID)

I receive the follow error:

Cannot find an overload for "vmTemplate_List" and the argument count: "1"

Could you help, please?

Thanks

Sgwalker1969 avatar Jul 28 '20 16:07 Sgwalker1969

Hi,

Please change the script to: $vTemplateSvc= New-Object VMware.Hv.VmTemplateService $vTemplateList= $vTemplateSvc.VmTemplate_List($hvServices, $vCenterID)

psurad avatar Jul 29 '20 07:07 psurad

Hi,

Please change the script to: $vTemplateSvc= New-Object VMware.Hv.VmTemplateService $vTemplateList= $vTemplateSvc.VmTemplate_List($hvServices, $vCenterID)

A question: which value for $hvServices?

Sgwalker1969 avatar Jul 29 '20 09:07 Sgwalker1969