PowerShell Logo Small

Invoke-RestMethod



This is the built-in help made by Microsoft for the command 'Invoke-RestMethod', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Sends an HTTP or HTTPS request to a RESTful web service.

SYNTAX


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>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Invoke-RestMethod cmdlet sends HTTP and HTTPS requests to Representational State Transfer (REST) web services that returns richly
structured data.


Windows PowerShell formats the response based to the data type. For an RSS or ATOM feed, Windows PowerShell returns the Item or Entry XML
nodes. For JavaScript Object Notation (JSON) or XML, Windows PowerShell converts (or deserializes) the content into objects.


This cmdlet is introduced in Windows PowerShell 3.0.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=217034
ConvertTo-Json
ConvertFrom-Json
Invoke-WebRequest

REMARKS

<

Examples


Example 1

PS C:\>Invoke-RestMethod -Uri http://blogs.msdn.com/powershell/rss.aspx | Format-Table -Property Title, pubDate
Title pubDate-----------
Another Holiday Gift from the PowerShell Team: PowerShell 3.0 CTP2... Thu, 22 Dec 2011 00:46:00 GMT
More Videos from the First PowerShell Deep Dive Mon, 10 Oct 2011 19:59:00 GMT
PowerShell Deep Dive Lineup Thu, 06 Oct 2011 00:42:00 GMT
Windows Management Framework 3.0 Community Technology Preview (CTP... Mon, 19 Sep 2011 23:56:26 GMT
Get-Help -Online Fails in German Tue, 23 Aug 2011 15:02:00 GMT
PowerShell Deep Dive Registration Info & Call for Session Proposals Wed, 20 Jul 2011 00:25:00 GMT
Invoke-Expression considered harmful Fri, 03 Jun 2011 15:43:00 GMT
PowerShell at TechEd 2011 Thu, 28 Apr 2011 16:58:36 GMT
PowerShell Language now licensed under the Community Promise Sat, 16 Apr 2011 00:13:00 GMT
Scaling and Queuing PowerShell Background Jobs Mon, 04 Apr 2011 20:30:58 GMT
More Deep Dive Info, Including Abstracts from the PowerShell Team Sun, 13 Mar 2011 01:35:42 GMT
A Few Deep Dive Abstracts Sat, 05 Mar 2011 00:26:00 GMT
Reminder: Register for the PowerShell Deep Dive Conference & submi... Wed, 23 Feb 2011 17:55:45 GMT



This command uses the Invoke-RestMethod cmdlet to get information from the Windows PowerShell Blog RSS feed. The command uses the Format-Table
cmdlet to display the values of the Title and pubDate properties of each blog in a table.