cmdlet在哪个版本的PowerShell中可用

cmdlet在哪个版本的PowerShell中可用

本文介绍了Invoke-WebRequest cmdlet在哪个版本的PowerShell中可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要运行使用Invoke-WebRequest Cmdlet的命令,我将其复制到了一行(加上回声) )脚本为:

To run this command that uses the Invoke-WebRequest Cmdlet, I copied it into a one-line (plus echo) script as:

thufir >
thufir >
thufir > $PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.8762
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1


thufir >
thufir > type .\json_request.ps1

"start"

(Invoke-WebRequest http://ipinfo.io/json | ConvertFrom-JSON).ip

"done"
thufir >
thufir > .\json_request.ps1
start
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At C:\Users\604-083234\Desktop\json_request.ps1:4 char:19
+ (Invoke-WebRequest <<<<  http://ipinfo.io/json | ConvertFrom-JSON).ip
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

done
thufir >

PowerShell V2中不存在Cmdlet.哪个版本的PowerShell包含Invoke-WebRequest Cmdlet?

The Cmdlet does not exist in PowerShell V2. What version of PowerShell includes the Invoke-WebRequest Cmdlet?

推荐答案

Invoke-WebRequest在PowerShell版本3中可用

The Invoke-WebRequest became available in PowerShell version 3

这篇关于Invoke-WebRequest cmdlet在哪个版本的PowerShell中可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 20:18