From 99c56ba7815a47f77f64d3f01ef6b7b8551937c7 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 13 May 2025 17:47:53 +0530 Subject: [PATCH] Handle both literal and non-literal paths --- templates/powershell.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/powershell.txt b/templates/powershell.txt index 277db86..e99e361 100644 --- a/templates/powershell.txt +++ b/templates/powershell.txt @@ -106,8 +106,11 @@ function global:__zoxide_z { elseif ($args.Length -eq 1 -and ($args[0] -eq '-' -or $args[0] -eq '+')) { __zoxide_cd $args[0] $false } - elseif ($args.Length -eq 1 -and (Test-Path $args[0] -PathType Container)) { - __zoxide_cd $args[0] $(Test-Path -LiteralPath $args[0]) + elseif ($args.Length -eq 1 -and (Test-Path $args[0] -PathType Container -LiteralPath)) { + __zoxide_cd $args[0] $true + } + elseif ($args.Length -eq 1 -and (Test-Path $args[0] -PathType Container -Path)) { + __zoxide_cd $args[0] $false } else { $result = __zoxide_pwd