VMware Cloud Community
RussellSeymour
Contributor
Contributor

Is it possible to set the vCloud API Version to use when using PowerCLI?

Hello,

PowerCLI Version: 5.5.0.6316

PowerShell version: 4

I am automating the creation of vApps and VMs using the tools in PowerCLI.  During testing I have been using two different vCloud Datacentres, one of which is running vCloud 5.1 and the other 5.5.

The problem is that on the newer site, the customisations are not running properly when configured on the virtual machine.  The hosting provider has tested both sites using the API directly and they do not see the issues I have, but they only use API version 5.1.  So that I can test things I want to downgrade the API version that is used against this data centre.

I see that when PowerCLI makes its calls to vCloud it sets the REST API Headers to use the same version of vCloud that it connected to.  Is there anyway to change the API version that is used in REST calls that are made with PowerCLI?

I am not saying that the versions are the cause of the issue, but I want to ensure that all the tests that are done are performed consistently.

Thanks very much, Russell

Tags (2)
Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Moved to the vCloud Director PowerCLI community.


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

Reply
0 Kudos
CNI0
Enthusiast
Enthusiast

Hi

I had the same issues and filed a SR. They came back with this.

You can specify Version 5.1 compatibility with this line:

[VMware.VimAutomation.Cloud.Views.CloudClient]::ApiVersionRestriction.ForceCompatibility("5.1")

And revert back to version 5.5

[VMware.VimAutomation.Cloud.Views.CloudClient]::ApiVersionRestriction.RevertCompatibility()

Reply
0 Kudos