How to parse JSON from the Invoke-WebRequest in PowerShell?

前端 未结 3 491
死守一世寂寞
死守一世寂寞 2020-12-03 02:53

When sending the GET request to the server, which uses self-signed certificate:

add-type @\"
    using System.Net;
    using System.Security.Cryptography.X50         


        
3条回答
  •  有刺的猬
    2020-12-03 03:34

    This way:

    $response = Invoke-WebRequest -Uri 
    if ($response.statuscode -eq '200') {
        $keyValue= ConvertFrom-Json $response.Content | Select-Object -expand ""
    }
    

提交回复
热议问题