diff --git a/templates/powershell.txt b/templates/powershell.txt index bc86cdc..6f2e0e7 100644 --- a/templates/powershell.txt +++ b/templates/powershell.txt @@ -80,9 +80,9 @@ function global:__zoxide_hook { {%- endif %} # Initialize hook. -$__zoxide_hooked = (Get-Variable __zoxide_hooked -ErrorAction SilentlyContinue -ValueOnly) -if ($__zoxide_hooked -ne 1) { - $__zoxide_hooked = 1 +$global:__zoxide_hooked = (Get-Variable __zoxide_hooked -ErrorAction SilentlyContinue -ValueOnly) +if ($global:__zoxide_hooked -ne 1) { + $global:__zoxide_hooked = 1 $__zoxide_prompt_old = $function:prompt function global:prompt {