How to update posh-git

旧城冷巷雨未停 提交于 2019-12-05 04:56:30

All it does is look if the script is being sourced in your profile:

$profileLine = ". '$installDir\profile.example.ps1'"
if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) {
    Write-Host "It seems posh-git is already installed..."
    return
}

Since it seems to have the installDir as the folder from which you run the install script, merely upgrading the folder with the newer version of posh-git should give have updated the files already.

If you are not comfortable with that, just remove the line that sources the profile.example.ps1 in your profile and run the install again :)

If installed via PsGet, you can just run

Update-Module posh-git

I had installed via PsGet, so I renamed the folder

C:\Users\[myName]\Documents\WindowsPowerShell\Modules\posh-git

and re-ran

Install-Module posh-git

It downloaded the latest but told me it was already installed, probably because I hadn't removed the lines from Microsoft.PowerShell_profile.ps1. That was all I needed, though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!