curl vs Invoke-Webrequest [英] curl vs Invoke-Webrequest
问题描述
伙计们,你好吗?
对不起,这个问题,但是我尝试实施而没有成功。
Sorry for the question, but I try implement and without successful.
我用过de curl html页面中的帖子信息。这是我使用的命令。
I used de curl for post information in html page. This is command that I used.
curl -X PUT --data" description = text i put html& enabled = 1" myip / page / info
curl -X PUT --data "description=text i put html&enabled=1" myip/page/info
这对我来说非常有用。但是我需要创建一个powershell脚本,在那里我使用了curl的cmdlet兼容性。我验证命令Invoke-Webrequest是否可能。另外,我通过invoke-webrequest检查是否存在传递post的方法。
This is works perfectly for me. But I need create a powershell script, where I used the cmdlet compatibility that curl. I verify the command Invoke-Webrequest its a possible. Also I check that there are methods, passing post, with the invoke-webrequest.
但是由于我没有使用方法获取和发布以及稍微安装命令的经验。
But as I have no experience with methods gets and posts and hitting a little to mount the command.
谢谢,再次抱歉。
推荐答案
您好AbreuF,
Hi AbreuF,
我不确定你将要做什么,但下面是一个关于如何使用Invoke-WebRequest来搜索单词"Invoke-WebRequest"的例子。在Bing.com上,过滤包含"TechNet"的标题的链接。
I'm not sure exactly what you will be trying to do but below is an example on how to use Invoke-WebRequest to search for the word "Invoke-WebRequest" on Bing.com and filter the links with title that contains "TechNet".
# Search "Invoke-WebRequest" on Bing.com using Invoke-WebRequest
Invoke-WebRequest `
-Uri http://www.bing.com/search?q=Invoke-WebRequest | `
ForEach-Object { `
# Search links containing TechNet
_ |选择-Expand Links | `
Where-Object {
_ | Select -Expand Links | ` Where-Object {
_。innerHTML -like'* TechNet *'}`
};
_.innerHTML -like '*TechNet*'} ` } ;
示例输出
Example Output
有关Invoke-WebRequest cmdlet的详细信息,请阅读以下文档的更多信息。 ;
For more information about Invoke-WebRequest cmdlet, you can read more on the documentation belows;
- Microsoft TechNet - 用于Windows PowerShell 3.0的Invoke-WebRequest
- Microsoft TechNet - 用于Windows PowerShell 4.0的Invoke-WebRequest
- Microsoft TechNet - 用于Windows PowerShell 5.0的Invoke-WebRequest
问候,
Ryen Tang
Regards,
Ryen Tang
这篇关于curl vs Invoke-Webrequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!