Managing machines

Now, we will look at ways to manage the machines in a tenant. For this, we will start by checking a list of all available catalog items.

Listing shared and private catalog items

To get a list of catalog items, first build the header:

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add('Content-Type', 'application/json')
$headers.Add('Authorization', "Bearer $token")

Next, simply query the resources:

PS C:\> (Invoke-RestMethod -Method Get -Uri 
"https://vra.lab.com/catalog-
service/api/consumer/entitledCatalogItems" -Headers 
$headers).Content.catalogItem[0] | ConvertTo-Json

We get a list of items. For readability and easy understanding, we will select only one output. Since the output is ...

Get Mastering PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.