我有一个旧版本的posh-git,我想要更新它(同时试图解决powershell启动缓慢的问题)
我已经从存储库中获取了最新的内容,当我尝试执行.\install.ps1时,我会得到
It seems posh-git is already installed...如何更新posh-git?
发布于 2013-05-21 01:07:37
它所要做的就是查看脚本是否来源于你的个人资料:
$profileLine = ". '$installDir\profile.example.ps1'"
if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) {
Write-Host "It seems posh-git is already installed..."
return
}由于它似乎将installDir作为运行安装脚本的文件夹,因此只需使用较新版本的posh-git升级该文件夹就已经更新了这些文件。
如果您对此不满意,只需删除配置文件中的profile.example.ps1源代码行,然后再次运行安装程序:)
发布于 2016-09-07 16:16:34
如果通过PsGet安装,您只需运行
Update-Module posh-git发布于 2015-08-29 03:08:17
我是通过PsGet安装的,所以我重命名了该文件夹
C:\Users\[myName]\Documents\WindowsPowerShell\Modules\posh-git
并重新运行
Install-Module posh-git
它下载了最新的,但告诉我它已经安装了,可能是因为我没有从Microsoft.PowerShell_profile.ps1中删除这些行。不过,这就是我所需要的。
https://stackoverflow.com/questions/16654372
复制相似问题