How it works...
As an example, use a JSON interface to query the registry.hub.docker.com web page. This permits the use of Invoke-WebRequest and returns a JSON-formatted string. The invoke-WebRequest cmdlet performs a lookup of the specified URL. In this case, it's the CentOS tag's web page and returns a name field. The query contains the website, the API, the name, and the format that's been requested. After execution, the data is converted from JSON using ConvertFrom-Json.
In the function, we create a simple begin block with a ping test to the URI. We look for the HTML status code (200 stands for success). Once done, we fetch the JSON from the page, and then strip out only the name field to get a list of all of the tags that are available ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access