This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --- Convert the JSON string to an object | |
| $Object = (Get-vRAConsumerCatalogItemRequestTemplate -Name "A Catalog Item" | ConvertFrom-JSON) | |
| # ---Build the request | |
| $RequestProperties = $Object.data.VM.data | |
| $RequestProperties.Hostname = "MyHostname" | |
| $RequestProperties.cpu = 2 | |
| $RequestProperties.memory = 2048 | |
| # ---- Submit the request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Get the first datastore in the array | |
| var dataStores = vcVirtualMachine.datastore; | |
| var dataStore = dataStores[0].name; | |
| System.log("Found first datastore in array: " + dataStore); | |
| //Get datastore prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-vRAConsumerCatalogItem | ? {$_.Name -like "*LIKE*"} | Select Id, Name | % {Get-vRAConsumerCatalogItemRequestTemplate -Id $_.Id | Out-File -FilePath ".\Data\$($_.Name).json"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while($true) {(Get-vRAConsumerRequest -RequestNumber 2397).State; sleep 5} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (Get-Content .\code\vRO\CatalogItem1.json -raw) | Request-vRAConsumerCatalogItem -Verbose -Wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ReservationName = "Reservation1" | |
| $CatalogResources = Get-vRAConsumerResource -WithExtendedData | ? {($_.ResourceType -eq "Infrastructure.Virtual") -and ($_.Data.MachineReservationName -eq $ReservationName)} | |
| $CatalogResources | Select ResourceId, Name, @{Name="Reservation"; Expression={$_.Data.MachineReservationName}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-vRAConsumerResource -WithExtendedData | ? {$_.ResourceType -eq "Infrastructure.Virtual"} | Select ResourceId, Name, @{Name="Reservation"; Expression={$_.Data.MachineReservationName}} | Sort-Object -Property Reservation, Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-vRABusinessGroup | Select Name, @{Name="GroupManagers"; Expression={$_.GroupManagerRole.Name}}, @{Name="SupportUsers"; Expression={$_.SupportUserRole.name}}, @{Name="BuisinessUsers"; Expression={$_.UserRole.name}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-vRAEntitlement | Select Name, @{Name="Principals"; Expression={$_.Principals.ref}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Object = [PSCustomObject]@{ | |
| Id = "1" | |
| Name = "VM01" | |
| Description = "A virtual machine" | |
| Location = "UK" | |
| IPAddress = "10.0.0.1" | |
| } |