mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-21 02:55:37 -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
|
||||
try {
|
||||
if ($null -ne $global:OMP_GLOBAL_SESSIONSTATE) {
|
||||
if (Test-Path variable:global:OMP_GLOBAL_SESSIONSTATE) {
|
||||
$stackCount = $global:OMP_GLOBAL_SESSIONSTATE.Path.LocationStack('').Count
|
||||
}
|
||||
} catch {}
|
||||
|
|
Loading…
Reference in a new issue