当我在PowerShell 5中输入命令Get-WindowsFeature
时,它显示此错误,我不知道为什么!
Get-WindowsFeature: The term "Get-WindowsFeature" is not recognized as a cmdlet name,
function, script file or executable program. Check the spelling of the name, or if a path
access exists, verify that the path is correct and try again.
To the character Line: 1: 1
+ Get-WindowsFeature
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo: ObjectNotFound: (Get-WindowsFeature: String) [], CommandNotFoundException
+ FullyQualifiedErrorId: CommandNotFoundException
答案 0 :(得分:2)
Get-WindowsFeature不是PowerShell 5的一部分,而是Server Manager
模块的一部分,该模块未安装或加载,因为错误消息明确指出,您尝试执行的命令不可用
使用Import-Module ServerManager
导入,或Import-Module -ListAvailable
查看是否已安装。
答案 1 :(得分:0)
确保您不尝试通过Powershell(x86)访问Get-ImportModule。不在那里使用常规的Powershell,就可以了。