术语“Invoke-WebRequest"未被识别为 cmdlet 的名称 [英] The term 'Invoke-WebRequest' is not recoginzed as the name of a cmdlet

查看:449
本文介绍了术语“Invoke-WebRequest"未被识别为 cmdlet 的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在执行 Invoke-WebRequest cmdlet 时遇到问题.我读到大约 100% 的情况是 PS 版本低于 3,但这不是我的情况:

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

我可以补充一点,我使用的是 Windows 10 IoT Core 版本的操作系统.事实上,我的主要目的是执行简单的 web 请求,但我很感兴趣为什么这个 cmdlet 不起作用,特别是如果更多的 cmdlet 不起作用;/我想它可能是一些 Windows 功能,比如打开开关,但它的只是我的猜测.

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.

更新

就我比较某些模块的可用 cmdlet 以及我的常规系统和 IoT 版本之间的预加载程序集而言,看起来后者版本以某种方式被削减了,但我仍然没有看到任何相关文档.

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.

推荐答案

我在 Windows Server 2008 R2 服务器上遇到了这个问题,因为它运行的是 PowerShell v2.升级到 v4 解决了这个问题.

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

Windows 管理框架 4.0(包括 PowerShell 4.0)

Windows Management Framework 4.0 (includes PowerShell 4.0)

从 v5 开始,Invoke-WebRequest仍然记录在案.

As of v5, Invoke-WebRequest is still documented.

检查您的版本:

$PSVersionTable.PSVersion

这篇关于术语“Invoke-WebRequest"未被识别为 cmdlet 的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆