add-type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public bool CheckValidationResult( ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { return true; } }"@[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy$user = 'APIKEY'$pass = 'APISECRET'$pair = "$($user):$($pass)"$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))$basicAuthValue = "Basic $encodedCreds"$Headers = @{ Authorization = $basicAuthValue}$URL = "https://IPOFROUTER/api/core/firmware/upgrade"Invoke-WebRequest -uri $url -method post -Headers $Headers -Body '{"upgrade":"maj"}' -ContentType "application/json"