Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The term 'Invoke-WebRequest' is not recoginzed as the name of a cmdlet

I've got problem with executing Invoke-WebRequest cmdlet. I read that ~100% case of that scenario is PS version lower than 3, but it's not my case:

Name                           Value ----                           ----- WSManStackVersion              3.0 PSRemotingProtocolVersion      2.3 CLRVersion                     4.0.30319.34011 PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...} BuildVersion                   10.0.10208.0 PSVersion                      5.0.10208.0 SerializationVersion           1.1.0.1 

I can add that I'm using Windows 10 IoT Core version of OS. In fact my main purpose is execution of simple web request, but I am interested why this cmdlet is not working, especially if more of them won't be ;/ I suppose it can be some windows feature like switch to turn on, but its just my guess.

Update

As far as I compared available cmdlets for certain modules, and preloaded assemblies between my regular system and an IoT version, it looks like the latter version is cut somehow, but I still didn't see any docs for that.

like image 978
Dawid Komorowski Avatar asked Aug 31 '15 16:08

Dawid Komorowski


People also ask

What is invoke-WebRequest in PowerShell?

Description. The Invoke-WebRequest cmdlet sends HTTP, HTTPS, FTP, and FILE requests to a web page or web service. It parses the response and returns collections of forms, links, images, and other significant HTML elements. This cmdlet was introduced in Windows PowerShell 3.0.

Does invoke-WebRequest use proxy?

Beginning in PowerShell 7.0, Invoke-WebRequest supports proxy configuration defined by environment variables.


1 Answers

I had this issue on a Windows Server 2008 R2 server, because it was running PowerShell v2. Upgrading to v4 fixed the issue.

Windows Management Framework 4.0 (includes PowerShell 4.0)

As of v5, Invoke-WebRequest is still documented.

Check your version with:

$PSVersionTable.PSVersion 
like image 118
Fenton Avatar answered Sep 19 '22 06:09

Fenton