Saturday, May 11, 2019

Powershell: curl equivalent command

If your Powershell version is higher than 3, 'Invoke-RestMethod' command is available as alternative method of Unix/Linux curl command.

>> Check the version of your powershell.


PS C:\Users\drago> $PSVersionTable.PSVersion | Select-Object major

Major
-----
5


>> And just type URI whatever you want to retrieve
PS C:\Users\drago> Invoke-RestMethod -Uri https://www.msn.com -Method Get




I tried to process the result with piped 'Select-String', though couldn't filter the result.


The command is not so easy as curl, further study is still needed for it.

No comments:

Post a Comment