VMware Cloud Community
aterrell5
Contributor
Contributor

PowerCLI 13.0.0 b20829139 - New-WMNamespacePermission completes permission creation but gives error

I've been working on a PowerCLI script to integrate with our catalog for adding a new VMware Workload Namespace and assigning the admin team permissions. The script is working and even the permissions are being added properly, but the error still triggers a failure result. Any ideas if this is a bug or something I'm missing? 

This is the command the script runs: 

New-WMNamespacePermission -Namespace $OUR-APP-NAMESPACE -Role Edit -Domain $INTERNALSSODOMAIN -PrincipalType User -PrincipalName $ADMINUSERNAMEHERE

 

New-WMNamespacePermission : 1/25/2023 10:40:19 AM       New-WMNamespacePermission               Sequence contains no matching element
At line:1 char:1
+ New-WMNamespacePermission -Namespace OUR-APP-NAMESPACE -Role Edit -Doma ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-WMNamespacePermission], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.WorkloadManagement.Commands.Cmdlets.NewWMNamespacePermission

 

The script completes with the error code returned but when checking in vCenter the permissions are defined and the users are able to authenticate properly. 

PowerCLI Version
----------------
VMware.PowerCLI 13.0.0 build 20829139
---------------
Component Versions
---------------
VMware Common PowerCLI Component 13.0 build 20797081
VMware Cis Core PowerCLI Component PowerCLI Component 13.0 build 20797636
VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 13.0 build 20797821
VMware VimAutomation Storage PowerCLI Component PowerCLI Component 13.0 build 20797966
VMware VimAutomation Vds Commands PowerCLI Component PowerCLI Component 13.0 build 20803944
VMware Workload Management PowerCLI Component PowerCLI Component 12.4 build 18627055

 

0 Kudos
1 Reply
LucD
Leadership
Leadership

Looks indeed like an issue.
You could try to provide a VIRole object (-Role (Get-VIRole -Name 'Edit'))instead of a String, but that is just a wild guess.


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

0 Kudos