PowerCLI-Example-Scripts
PowerCLI-Example-Scripts copied to clipboard
Get-VMCSDDC doesn't handle SDDC names with special characters
Quoted SDDC Name w/o character escape:
> Connect-NSXTProxy -RefreshToken XXXXX -OrgName"M5 EA - MYORG(Free!)"-SDDCName"ORG-VMC-VA-EA-M5"
A server error occurred: 'com.vmware.vapi.std.errors.unauthorized': . Check $Error[0].Exception.ServerError for more details.
At /Users/User/Powershell/VMware.VMC.NSXT.psm1:31 char:9
+ $sddc = $sddcService.get($orgId,$sddcId)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], CisServerException
+ FullyQualifiedErrorId : VMware.VimAutomation.Cis.Core.Types.V1.CisServerException
This is not an NSX-T based SDDC
==
Quoted SDDC Name with character escape:
> Connect-NSXTProxy-RefreshToken XXXXXXXX -OrgName"M5 EA - MYORG \(Free\!\)"-SDDCName"ORG-VMC-VA-EA-M5"
headers Server ------- ------ {Accept, Content-Type, csp-auth-token} https://nsx-XXXXX.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/XXX/sddcs/5XXXX