powershell microsoft.powershell.utility模块无法加载

发布于 2025-01-23 06:26:44 字数 653 浏览 0 评论 0原文

我在安装了Windows 10的全新工作站中遇到了这个问题:在PowerShell上,5.1,当我调用“写入主机'test'”时,我会收到

Write-Host : The 'Write-Host' command was found in the module 
'Microsoft.PowerShell.Utility', but the module could not
be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'.
At line:1 char:1

+ Write-Host "test"
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Write-Host:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

,如果我尝试导入模块,我会收到错误。 我安装了PowerShell 7.2,在这种情况下,我没有问题,但是出于兼容原因,我必须使用5.1。 我已经尝试删除/重新安装PowerShell Windows功能,但没有办法。

有人有建议吗?

谢谢

I have this problem in a brand new workstation with Windows 10 installed: on powershell, the 5.1, when I call "Write-Host 'test'" I receive

Write-Host : The 'Write-Host' command was found in the module 
'Microsoft.PowerShell.Utility', but the module could not
be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'.
At line:1 char:1

+ Write-Host "test"
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Write-Host:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

And if I try to Import-Module I receive an error.
I installed the powershell 7.2 and in that case I have no problem, but I must use the 5.1 for compatibility reasons.
I already tried to remove/reinstall the powershell windows feature but no way.

Does anyone have a suggestion?

Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文