![](/img/trans.png)
[英]Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet
[英]PowerShell x64 does not recognize Install-Module is not recognized as the name of the cmdlet
我知道 Install-Module 是 PowerShell 5 或更高版本的功能。
我正在使用 OS-build:19042.746 運行 Windows 10 專業版 20H2
我使用$PSVersionTable
檢查了 PS 的版本。 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
我在尋找修復程序時發現的另一件事是, PowerShell x86版本工作正常,沒有任何問題。
我無法運行 Window 管理框架 5.1,因為它是為了讓其他系統升級 PowerShell。 但是,我正在運行最新版本。
64位有什么解決辦法嗎?
我發現的一種解決方法是將Program Files (x86)\WindowsPowershell
中的Modules
文件夾復制到Program Files\WindowsPowershell
(64 位文件夾)。 不知何故,這些模塊已從 64 位 Powershell 文件夾中刪除。 我無法確定確切原因,但我懷疑罪魁禍首可能是KB5001330更新。
呵呵,不知道這是不是bug?
PowerShell x86 版本工作正常,沒有問題。
此評論沒有意義,因為Install-Module
是PowerShellGet
模塊的一部分,它不應該關心您是否正在運行 x64 或 x86 shell。 無論如何,這里有一些你可以嘗試的事情。
PowerShellGet
( PackageManagement
是一個依賴項)。 有關的:# check if PowerShellGet is available locally
Get-Module PowerShellGet -List
# check if PackageManagement is available locally
Get-Module PackageManagement -List
.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'
我不知道這是否是一個錯誤。 我剛剛重新安裝了 windows,問題得到了解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.