To send web request and read JSON response using PowerShell I used following commands
$response = Invoke-WebRequest -Uri "http://myserver.com" -Method Get -Headers @{"apikey"="toekn"}
$responseAsPSObject = $response.Content | ConvertFrom-Json
$myValue = $responseAsPSObject.Value."mykey"
Write-Host "$myValue"
No comments:
Post a Comment