Automated vRealize Automation Deployments : Solution Design : 2.7 PowerShell Script Configuration : 2.7.4 Leveraging Cloud Client with PowerShell
   
2.7.4 Leveraging Cloud Client with PowerShell
After the credentials for the administrator@vsphere.local account have been set, proceed to execute the CloudClient commands to add the required accounts to the tenant administrator role and IaaS administrator role:
 
In this example, variables are declared to construct the CloudClient commands “vra tenant identity store add” and “vra tenant admin update” with the desired parameters, of which the former requires the administrator@vsphere.local credentials. We then use the “Invoke-Expression” PowerShell commandlet to run the resulting CloudClient commands.
Once we have completed the necessary commands to update the tenant and IaaS administrator roles, we can update the environment credential variables for proper execution of vRealize Automation tenant constructs.
At this point, additional scripting can be created to continue the customer configuration of the tenant, such as:
Creation of the customer’s vCloud Director OrgVDC as an endpoint
Fabric group creation
Machine prefix
Business group creation
Additionally, services, entitlements, and the required actions can be created for the consumption of pre-created converged blueprints backed by standard templates offered by the VMware Cloud Provider. After the necessary scripted tasks have been completed, reservations are created manually and the vRealize Automation instance can be turned over to the customer.