我想在笔记本电脑上安装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 -Scope 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
我已经尝试了多种方法来更新PowerShellGet,但都没有成功。目前我使用的是v1.0.0.1版本。请问有什么建议或方法可以解决这个问题?非常感谢。