我想在笔记本电脑上安装 posh-git,但是当我尝试使用命令“PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force”安装时出现错误:
Install-Module : A parameter cannot be found that matches parameter name
'AllowPrerelease'.
At line:1 char:58
+ ... et\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], Paramet
erBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Install-Module
阅读 github 站点上的勘误表,我看到它说我需要使用“Install-Module PowerShellGet -S 应对 CurrentUser -Force -AllowClobber”更新我的 PowerShellGet 模块,但这会产生错误:
PackageManagement\Install-Package : The module 'PackageManagement' cannot be
installed or updated because the authenticode signature of the file
'PackageManagement.cat' is not valid.
At C:\Program
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809
char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallP
ackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : InvalidAuthenticodeSignature,ValidateAndGet-Au
thenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.Insta
llPackage
我已经用谷歌搜索并尝试了几种方法来从我的笔记本电脑上显示的 v1.0.0.1 更新 PowerShellGet,但都无济于事。任何有关如何纠正此问题的建议将不胜感激。