我正在运行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
答案 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 中返回任何内容