mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(pwsh): validate existence of global variable
This commit is contained in:
parent
fccdfe5306
commit
2b92304c77
|
@ -272,7 +272,7 @@ Example:
|
||||||
|
|
||||||
$stackCount = (Get-Location -Stack).Count
|
$stackCount = (Get-Location -Stack).Count
|
||||||
try {
|
try {
|
||||||
if ($null -ne $global:OMP_GLOBAL_SESSIONSTATE) {
|
if (Test-Path variable:global:OMP_GLOBAL_SESSIONSTATE) {
|
||||||
$stackCount = $global:OMP_GLOBAL_SESSIONSTATE.Path.LocationStack('').Count
|
$stackCount = $global:OMP_GLOBAL_SESSIONSTATE.Path.LocationStack('').Count
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
Loading…
Reference in a new issue