fix(pwsh): check presence of "posh-git" module

This commit is contained in:
L. Yeung 2022-08-18 22:23:33 +08:00 committed by Jan De Dobbeleer
parent 08eb57bf96
commit dbcfab3480

View file

@ -26,7 +26,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
$env:POSH_THEME = (Resolve-Path -Path ::CONFIG::).ProviderPath
}
# specific module support (disabled by default)
if ($null -eq $env:POSH_GIT_ENABLED) {
if (($null -eq $env:POSH_GIT_ENABLED) -or ($null -eq (Get-Module 'posh-git'))) {
$env:POSH_GIT_ENABLED = $false
}