I am using power shell code as:
$web_client = new-object system.net.webclient
$build_info=web_client.DownloadString("http://<URL>")
$suitevm_build_number=
$suitevmCLN=
$webapp_build=
$stats_build=
Output in browser while hitting http:// is:
{"message":null,"changeset":"340718","branch":"main","product":"productname","buildNumber":"1775951","todaysDate":"28-4-2014"}
What should I write the power shell code to get:
$suitevm_build_number=
$suitevmCLN=
$webapp_build=
$stats_build=
Best Answer
You're question is very unclear. If you have Powershell 3 or later, you can use
ConvertFrom-JSON
to convert the JSON-response to a object.Ex of output:
With PS 3+ you could also replace the webclient with
Invoke-RestMethod
as shown by @RickH.