When sending the GET request to the server, which uses self-signed certificate:
add-type @\" using System.Net; using System.Security.Cryptography.X50
If you have a need to use Invoke-WebRequest over Invoke-RestMethod you can convert it to an object by turning it into a string first
Invoke-WebRequest
Invoke-RestMethod
$response = Invoke-WebRequest -Uri "https://yadayada:8080/bla" $jsonObj = ConvertFrom-Json $([String]::new($response.Content))