From 42e5fdb51de0ac3f9a7c3e5fa714137b1d880bf7 Mon Sep 17 00:00:00 2001 From: matan h <56131718+matan-h@users.noreply.github.com> Date: Fri, 28 Jul 2023 11:38:04 +0300 Subject: [PATCH] mark `__zoxide_hooked` as global --- templates/powershell.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 {