powershell Get-NetAdapter命令无法识别

时间:2014-11-30 13:07:34

标签: powershell cmdlet

我正在运行Windows 7 Home Premium。 我安装了.Net4.5.1和Powershell 4.0 它安装成功。我可以验证,因为此命令返回:

PS C:\Users\Aubrey\Documents> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1  

但是我无法运行命令或脚本:

PS C:\Users\Aubrey\Documents> Get-NetAdapter
Get-NetAdapter : The term 'Get-NetAdapter' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if 
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-NetAdapter
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-NetAdapter:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

2 个答案:

答案 0 :(得分:5)

根据http://blogs.technet.com/b/heyscriptingguy/archive/2014/01/15/using-powershell-to-find-connected-network-adapters.aspx,NetAdapter模块(以及Get-NetAdapter命令)需要Windows 8或更高版本。

答案 1 :(得分:0)

“Get-NetAdapter”命令必须运行网络安装服务才能在 (Windows 10) PowerShell 中返回任何内容