Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 202 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet

#1
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.
Reply

#2
Trying to create the request in the same way I would do it for PS version 2 (using .net library instead of cmdlet) doesn't work either...

$request = [System.Net.WebRequest]::Create("https://google.com")
$request.Method = "GET"
[System.Net.WebResponse]$response = $request.GetResponse()


Reply

#3
Using -UseBasicParsing option in the command works. The following is part of the command's documentation

> -UseBasicParsing
>
> Indicates that the cmdlet uses the response object for HTML content without Document Object Model (DOM) parsing.
>
> This parameter is required when Internet Explorer is not installed on the computers, such as on a Server Core installation of a Windows Server operating system.
Reply

#4
Invoke-WebRequest has been stripped from PowerShell 5.

Here's an implementation of a function called Invoke-FastWebRequest that works just like the old Invoke-WebRequest in PowerShell 5:

[To see links please register here]

Reply

#5
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][1]* (includes PowerShell 4.0)

As of v5, `Invoke-WebRequest` is [still documented][2].

Check your version with:

$PSVersionTable.PSVersion

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#6
This appears to be removed in PowerShell Core.

I am searching for why this doesn't work on Docker for Windows running on Nano Server for Windows 2016 and your findings match mine.

Reply

#7
Though the PowerShell version and everything else was good at my end, I was unable to download the code from the desired repo. So, I've executed the following command first to satisfy the TLS version, and then I have executed my desired command to download the latest version of the githubActions runner.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri

[To see links please register here]

-win-x64-2.165.2.zip -OutFile actions-runner-win-x64-2.165.2.zip
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through