The Invoke-RestMethod cmdlet

The Invoke-RestMethod is the PowerShell cmdlet using which we can send an HTTP or HTTPS request to a RESTful Web service. This is the single most important cmdlet for this chapter, as we are going to manage the REST APIs of vRealize Automation using this cmdlet. The syntax for the cmdlet is as follows:

Invoke-RestMethod [-Uri] <Uri> [-Body <Object>] [-Certificate 
<X509Certificate>] [-CertificateThumbprint <String>] [-ContentType 
<String>] [-Credential <PSCredential>] [-DisableKeepAlive] [-Headers 
<IDictionary>] [-InFile <String>] [-MaximumRedirection <Int32>] [-
Method <WebRequestMethod>] [-OutFile <String>] [-PassThru] [-Proxy 
<Uri>] [-ProxyCredential <PSCredential>] [-
ProxyUseDefaultCredentials] [-SessionVariable ...

Get Mastering PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.