You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UNC Path handling for Invoke-FuzzyEdit doesn't work as expected. Additionally, I'd like to optimize the logic a bit within the function?
Reproduce
cd "\\servername\C$\Program Files"Invoke-FuzzyEdit## OR Invoke-FuzzyEdit'\\servername\C$\Users\'
Expected
I expect to open fzf within the current UNC path at the $PWD or within the -Directory passed in.
Actual
I received the below message and fzf opens in the $HOME directory on a non-elevated session.
'\\servername\c$'CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Solution
Wrap calls to Cmd.exe in current shell to pushd outside of current directory in case the $PWD is set at a UNC path. Secondly, within the Cmd.exe call, add a "DOS" pushd for the applicable UNC path. Additionally, for the optimizations, I'd like to remove the two cds when -Directory is used and the += array setting.
Description
UNC Path handling for
Invoke-FuzzyEdit
doesn't work as expected. Additionally, I'd like to optimize the logic a bit within the function?Reproduce
Expected
I expect to open
fzf
within the current UNC path at the$PWD
or within the-Directory
passed in.Actual
I received the below message and
fzf
opens in the$HOME
directory on a non-elevated session.Solution
Wrap calls to
Cmd.exe
in current shell topushd
outside of current directory in case the$PWD
is set at a UNC path. Secondly, within theCmd.exe
call, add a "DOS"pushd
for the applicable UNC path. Additionally, for the optimizations, I'd like to remove the twocd
s when-Directory
is used and the+=
array setting.Environment
Module Version:
2.3.2
Windows Powershell:
5.1.18362.1171
PowerShell Core:
7.2.1
WSL2 Ubuntu:
20.04.3 LTS
The text was updated successfully, but these errors were encountered: