VMware Cloud Community
LimbachD
Contributor
Contributor

Power CLI - Create New VM from Template

Hello,

so I have this short part of a Script where I want to create a new VM from a template.

 

$Template = Get-Template -Name 'WIN2019_Template'
VMware.VimAutomation.Core\New-VM -VMHost "Hostname" -Name $vmname -Datastore $datastoretouse -Template $Template -Verbose

 

 

However whenever I attempt to create the VM from a tempate or even from another existing VM with -VM I receive the following unknown error.

LimbachD_0-1626174130763.png

 

Labels (3)
Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

A few things to try:
- set the PS culture to en-US
- try adding the Portgroup parameter

If you see no improvement, I suggest opening an SR


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
LimbachD
Contributor
Contributor

Thanks for your fast reply. No luck unfortunately.

Set the Culture with Set-Culture and also tried using the portgroup

PS C:\WINDOWS\system32> Get-Culture

LCID Name DisplayName
---- ---- -----------
1033 en-US Englisch (USA)

 

Error Message stays the same

Reply
0 Kudos
LucD
Leadership
Leadership

Then I would definitely suggest opening an SR


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos