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 <String>] [-TimeoutSec <Int32>] [-TransferEncoding <String>] [-UseDefaultCredentials] [- UserAgent <String>] [-WebSession <WebRequestSession...