Since we have the token, we can start exploring the vRA environment. We will start by managing the tenants. First, let's get a list of existing tenants. From now onwards, we need to provide authorization for working with the resources. Since we already have a token, we need to pass the authorization as a parameter in the header itself. We will use the following format:
Authorization: Bearer $token
$token holds the authorization token. For this, we will build out the header. So, define a new object:
PS C:\>$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
Next, add the components of the header:
PS C:\> $headers.Add('Accept', 'application/json') PS C:\> $headers.Add('Authorization', "Bearer $token") ...