Skip to content

Instantly share code, notes, and snippets.

View jonathanmedd's full-sized avatar

Jonathan Medd jonathanmedd

View GitHub Profile
@jonathanmedd
jonathanmedd / Set-vRAProjectPUT.ps1
Created May 7, 2021 14:35
PUT style Set-vRAProject - to use if VMware ever implement a PUT method instead of PATCH
function Set-vRAProject {
<#
.SYNOPSIS
Update a vRA Cloud Project
.DESCRIPTION
Update a vRA Cloud Project
.PARAMETER Id
The ID of the Project to update
.PARAMETER Name
The Name of the Project to update
@jonathanmedd
jonathanmedd / Brickset-getThemes.ps1
Created January 15, 2021 17:43
Brickset getThemes
$body = @{
apiKey = $Script:BricksetConnection.apiKey
}
$response = Invoke-BricksetRestMethod -Method POST -URI '/getThemes' -Body $body
$response.themes
@jonathanmedd
jonathanmedd / combinedfruit.json
Created April 24, 2020 10:49
combinedfruit.json
[
{
"oranges": 10,
"pears": 5,
"bananas": 3
},
{
"oranges": 15,
"pears": 6,
"bananas": 7
@jonathanmedd
jonathanmedd / Combine_JSON_Array_subexpression_operator.ps1
Created April 24, 2020 10:48
Combine JSON files using Array subexpression operator
$data1 = Get-Content .\fruit1.json -Raw | ConvertFrom-Json
$data2 = Get-Content .\fruit2.json -Raw | ConvertFrom-Json
@($data1; $data2) | ConvertTo-Json | Out-File .\combinedfruit.json
@jonathanmedd
jonathanmedd / PSObject_does_not_contain_a_method_named_op_Addition.ps1
Created April 24, 2020 10:43
Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'
$data1 = Get-Content .\fruit1.json -Raw | ConvertFrom-Json
$data2 = Get-Content .\fruit2.json -Raw | ConvertFrom-Json
$data1 + $data2
Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'.
@jonathanmedd
jonathanmedd / fruit2.json
Created April 24, 2020 10:39
fruit2.json
{
"oranges": 15,
"pears": 6,
"bananas": 7
}
@jonathanmedd
jonathanmedd / fruit1.json
Created April 24, 2020 10:38
fruit1.json
{
"oranges": 10,
"pears": 5,
"bananas": 3
}
@jonathanmedd
jonathanmedd / Invoke-vRARestMethod-Blueprints.ps1
Created April 1, 2020 16:43
Invoke-vRARestMethod-Blueprints
$request = Invoke-vRARestMethod -Method GET -URI '/blueprint/api/blueprints'
$request.content | Format-Table Name,ProjectName
name projectName
---- -----------
Blueprint1 Project Alpha
Blueprint2 Project Alpha
Blueprint3 Project Beta
Blueprint4 Project Beta
@jonathanmedd
jonathanmedd / Get-vRAProject-vRACloud.ps1
Created April 1, 2020 16:26
Get-vRAProject-vRACloud
Get-vRAProject | Format-Table Name
Name
----
Project1
Project2
Project3
Project4
Project5
@jonathanmedd
jonathanmedd / Connect-vRAServer-api-mgmt-cloud-vmware-com.ps1
Created April 1, 2020 16:22
Connect-vRAServer-api-mgmt-cloud-vmware-com
Connect-vRAServer -Server api.mgmt.cloud.vmware.com -APIToken 'YvwgGYubGg1mriJMB04HHMig8y03El44JPPpi0BOlc78D93vXodQhq9NC5wUYXUn'
Server : https://api.mgmt.cloud.vmware.com
Token : kM84nBgU7CQnBjDWh7yLSE3DKThDo5M6gbuhN2A9C3dSbFuPaI9XXdDzdt4G39IH25AQGwzkPUzUdsP9p1V5kYq8ZdlRbXGTH66GNYUfb5VC0H64olLhPR60nCL09EQE9SaZQbUM2LAFZnB4YLKB8gjWvkVhQFs34Zr02WTFEdlU3FifZJDo5tYn76sto2gx88qIOUM2t7V6heG2a4uDIIl9hdRtMRkVBOVyPwjQuw2zNrG0LW28B5jbpahg51Jb5MzfpTWPNhYRyGstKcAw5d0FA5YIlKAiSrqutE1Xoy9JuYmSkHgcTHGA0pnpXSWTtsonNzMyVC6mngmVkLp5HuhaScZG0AX3IqkOO62nDyj0VpDn18Y1pCkBvbzEaofXf6xz0ssd7h11xPGUx4FscgdXFPk4nXuopvXvtPM0CYG3SlbPdHNV1J5EWc0Pt4uwN3P0SZvgTQyVRHi2FVG4KvP1vBGaDPRVSdDLgD5BSuccVBahnuugLNEyxbMU4JkC96U22cgoMPMLPnK4myQTVlZMlJFGzgpSVC7eWHTwCFJFm5l2MivFb5x8U39cRX7oRLmUbFQQoBJQRRfh6VoMwsJG27DsDwnx4XOrxMyKMqQzysPASJXy9PLJwkeuRqtnjoenMOf22zEF79yjrDjhQD6HJkMwFHsrPY5iPPqXTdW0xIYJaEvxENf9gy4vv12rg00BBbU9g5qVGy9PZq6WIUkIMU4YyqGkUJgFKDxd3VCDwW3BxuQGRXYEnbjqAOBSrbmX9soT7UYjnS58QuSrPgvEVebxOH8EOBZxx4k7uXV0E1nzZy