[英]PowerShell x64 does not recognize Install-Module is not recognized as the name of the cmdlet
I know Install-Module is a PowerShell 5 or above feature.我知道 Install-Module 是 PowerShell 5 或更高版本的功能。
I am running Windows 10 pro version 20H2 with OS-build:19042.746我正在使用 OS-build:19042.746 运行 Windows 10 专业版 20H2
I checked the version of PS using $PSVersionTable
.我使用
$PSVersionTable
检查了 PS 的版本。 The output is provided below. output 如下所示。
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.610
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.610
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Another thing that I found out while searching for the fix is that, The PowerShell x86 version is working fine and there are no issues.我在寻找修复程序时发现的另一件事是, PowerShell x86版本工作正常,没有任何问题。
I can't run the Window Management Framework 5.1 because it was meant for other systems to upgrade the PowerShell.我无法运行 Window 管理框架 5.1,因为它是为了让其他系统升级 PowerShell。 However, I am running the latest version.
但是,我正在运行最新版本。
Is there any fix for 64bit? 64位有什么解决办法吗?
A workaround I found is copying the Modules
folder in Program Files (x86)\WindowsPowershell
to Program Files\WindowsPowershell
(64 bit folder).我发现的一种解决方法是将
Program Files (x86)\WindowsPowershell
中的Modules
文件夹复制到Program Files\WindowsPowershell
(64 位文件夹)。 Somehow the modules got deleted from the 64 bit Powershell folder.不知何故,这些模块已从 64 位 Powershell 文件夹中删除。 I cannot pinpoint the exact reason but I suspect the culprit may be the KB5001330 update.
我无法确定确切原因,但我怀疑罪魁祸首可能是KB5001330更新。
Huh, I wonder if this is a bug?呵呵,不知道这是不是bug?
The PowerShell x86 version is working fine and there are no issues.
PowerShell x86 版本工作正常,没有问题。
This comment doesn't make sense as Install-Module
is part of the PowerShellGet
module, which shouldn't care if you're running the x64 or x86 shell.此评论没有意义,因为
Install-Module
是PowerShellGet
模块的一部分,它不应该关心您是否正在运行 x64 或 x86 shell。 Regardless, here's a few things you can try.无论如何,这里有一些你可以尝试的事情。
PowerShellGet
( PackageManagement
is a dependancy).PowerShellGet
( PackageManagement
是一个依赖项)。 Related:# check if PowerShellGet is available locally
Get-Module PowerShellGet -List
# check if PackageManagement is available locally
Get-Module PackageManagement -List
.NET
should have been installed with the operating system - check if it was. .NET
应该已经安装了操作系统 - 检查是否是。# Needs to be run in an Admin shell. Alternatively, us the gui in next point
Get-WindowsOptionalFeature -Online -FeatureName NetFx* | Format-Table
# if not, you can add it by going typing 'windows feature' in the start menu and going to
# 'Turn Windows feature on or off'
I don't know if it was a bug or not.我不知道这是否是一个错误。 I just reinstalled the windows and problem got fixed.
我刚刚重新安装了 windows,问题得到了解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.