Now that vROps APIs fully support REST, and PowerShell supports REST, how can I take a power shell script and do something like:
Thanks!
So you can use Invoke-RESTMethod to call the REST API. From that, it returns a json type of object which can be parsed through ConvertFrom-JSON. On the inverse, you should be able to use ConvertTo-JSON to create the command text to POST using Invoke-RESTMethod.
I personally haven't delved into this area yet and probably won't be able to, but I have used PowerShell a lot to do REST API interaction without difficulty so this should be no different.
So you can use Invoke-RESTMethod to call the REST API. From that, it returns a json type of object which can be parsed through ConvertFrom-JSON. On the inverse, you should be able to use ConvertTo-JSON to create the command text to POST using Invoke-RESTMethod.
I personally haven't delved into this area yet and probably won't be able to, but I have used PowerShell a lot to do REST API interaction without difficulty so this should be no different.
ok thanks!