VMware Cloud Community
chs1
Enthusiast
Enthusiast
Jump to solution

Rest API from Powershell- Create VM

Hi all,

Can anyone point me at a sample bit of code for using the REST API in vSphere 6.5 to create a new VM. Not PowerCLI, but using Invoke-RestMethod or Invoke-Webrequest.

I can authenticate with vCenter and GET the VM list etc, but my POSTs aren't working and I'm apparently making Bad Requests.

Thanks in Advance

Chris

0 Kudos
1 Solution

Accepted Solutions
chs1
Enthusiast
Enthusiast
Jump to solution

I've cracked the PowerShell/ REST API issues I was having above.

I've done an initial write up of "what worked for me" on my blog in case it's useful to anyone else: http://isjw.uk/powershell-and-rest-api-create-vm/

View solution in original post

0 Kudos
1 Reply
chs1
Enthusiast
Enthusiast
Jump to solution

I've cracked the PowerShell/ REST API issues I was having above.

I've done an initial write up of "what worked for me" on my blog in case it's useful to anyone else: http://isjw.uk/powershell-and-rest-api-create-vm/

0 Kudos