VIO Category | Vmware PowerCLI Reference

VIO Category

Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations

Step 1: Retrieve a object by running a Get command

You can READ objects by using Get-VIOauth2Client cmdlet. See example below:

# Retrieves all OAuth2 clients with names that start with "MyOAuth2Client".

Get-VIOauth2Client -Name "MyOAuth2Client*"

Step 2 : Run commands from the CRUD group

You can CREATE objects by using New-VIOAuth2Client cmdlet. See example below:

# Creates a registration for a public OAuth 2.0 client with the specified client ID, scopes, grant types, and redirect URL. The OAuth2 client must implement the Proof Key for Code Exchange (PKCE) protocol to be registered.

PS C:\> New-VIOAuth2Client ` -ClientId "my-public-oauth-client" ` -Name "My Public OAuth2 Client" ` -Scope @("openid", "profile", "user", "group") ` -GrantTypes @("authorization_code", "refresh_token", "password") ` -RedirectUris @("http://127.0.0.1:8877/authcode") ` -RefreshTokenTimeToLiveMinutes 43200 ` -RefreshTokenIdleTimeToLiveMinutes 43200 ` -PkceEnforced $true ` -PublicClient $true
You can UPDATE objects by using Complete-VIOAuth2ClientSecretRotation cmdlet. See example below:

# Forces an immediate secret rotation for an OAuth 2 client with client ID "my-client-id".

PS C:\> Get-VIOAuth2Client -Id "my-client-id" | Complete-VIOAuth2ClientSecretRotation
You can REMOVE objects by using Remove-VIOAuth2Client cmdlet. See example below:

# Deletes the registration with ID "my-ouath2-client".

PS C:\> Get-VIOAuth2Client -Id "my-ouath2-client" | Remove-VIOAuth2Client

Step 3: Explore More Related Commands:


Get-VIObjectByVIView This cmdlet converts a vSphere View object to a VIObject.
Set-VIOAuth2Client Updates the configuration of the OAuth2 client registered with the VMware Identity Broker.
Start-VIOAuth2ClientSecretRotation Initiates a rotation of the secret of an OAuth 2 client.