diff --git a/src/subcommand/init/shell/powershell.rs b/src/subcommand/init/shell/powershell.rs index e1988fb..ae5b5f6 100644 --- a/src/subcommand/init/shell/powershell.rs +++ b/src/subcommand/init/shell/powershell.rs @@ -35,8 +35,10 @@ function {} {{ }} else {{ $result = zoxide query @args - if ($LASTEXITCODE -eq 0) {{ + if ($LASTEXITCODE -eq 0 -and ((Test-Path $result) -eq $true)) {{ z_cd $result + }} else {{ + $result }} }} }}