When sending the GET request to the server, which uses self-signed certificate:
add-type @\" using System.Net; using System.Security.Cryptography.X50
This way:
$response = Invoke-WebRequest -Uri if ($response.statuscode -eq '200') { $keyValue= ConvertFrom-Json $response.Content | Select-Object -expand "" }