fix(pwsh): default stack count to 0

This commit is contained in:
Ajay Mehta 2022-05-22 13:08:21 -07:00 committed by GitHub
parent 8276799e9a
commit 9e13f1bba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,11 @@ if ($null -ne (Get-Module -Name "oh-my-posh-core")) {
}
function Get-PoshStackCount {
return (Get-Location -Stack).Count
$locations = Get-Location -Stack
if ($locations) {
return $locations.Count
}
return 0
}
New-Module -Name "oh-my-posh-core" -ScriptBlock {