Dav*_*ael 6 powershell windows-server-2008-r2
在Windows Server 2008 r2 sp1机器上,我使用chocolatey来安装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
Run Code Online (Sandbox Code Playgroud)
可能是在开始时缺少一些设置环境的脚本执行.如果你比我更了解并且可以提供一些帮助并且可以使我不必重建这台机器,我将非常高兴.
Sco*_*ott 10
游戏有点晚了,但最近遇到了这个问题.我发现我的PSModulePath没有包含重要路径.您可以通过运行以下命令来查看PSModulePath:
$ ENV:PSModulePath
要添加所需的路径,您可以运行此命令:
$ env:PSModulePath = $ env:PSModulePath +"; C:\ Windows\system32\WindowsPowerShell\v1.0\Modules \"
| 归档时间: |
|
| 查看次数: |
11818 次 |
| 最近记录: |