在 windows server 2008 r2 sp1 机器上,我使用巧克力来安装AWSTools.Powershell包。这反过来又安装了 powershell 3。现在,powershell 已经彻底坏了,我想不出任何修复它或卸载并重新安装它的方法。
我担心我唯一的答案是完全重建机器,但想问是否有办法修复它。
powershell 实际运行,只是似乎找不到任何内置 cmdlet。似乎它确实找到了别名,但无法执行它们下面的内容。例如,发出 ls 来查看目录内容会产生:
PS C:\Users\Administrator> ls
ls : The term 'Get-ChildItem' 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
+ ls
+ ~~
+ CategoryInfo : ObjectNotFound: (Get-ChildItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
可能只是在开始时缺少一些脚本的执行来设置环境。如果您比我了解更多并且可以提供一些帮助并且可以使我不必重建这台机器,我会很高兴。