Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $hub = 'HUB-FQDN'
- $json = '<JSON QUERY>'
- ### Trust Certificate
- 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
- ### Get data
- $result = (Invoke-WebRequest -Method GET -Uri https://$hub/lwl/api?json=$json | ConvertFrom-Json).table
- ### Show data
- $result
Advertisement
Add Comment
Please, Sign In to add comment