Article ID: 127707, created on Dec 7, 2015, last review on Dec 7, 2015

  • Applies to:
  • Operations Automation 6.0

Symptoms

The following error is thrown on attempt to execute the commands Invoke-WebRequest from KB126807:

The term 'Invoke-RestMethod' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, o
r if a path was included, verify that the path is correct and try again.
At line:1 char:34
+ $authResponse = Invoke-RestMethod <<<<  -Method POST -Uri "https://login.microsoftonline.com/$tenantId/oauth2/token" -ContentType "application/x-ww
w-form-urlencoded" -body $authParams
    + CategoryInfo          : ObjectNotFound: (Invoke-RestMethod:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Cause

The Invoke-RestMethod cmdlet was introduced in Powershell 3.0 which is missing or not installed on Office 365 endpoint server.

Resolution

Make sure that Powershell 3.0 is installed on the endpoint server.

Search Words

The term 'Invoke-RestMethod' is not recognized as the name of a cmdlet, function, script file, or operable program.

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF