Closed dstcruz closed 5 years ago
I have a commit up that uses New-Alias
instead of Set-Alias
- see https://github.com/kelleyma49/PSFzf/commit/5490cda782556300e291b5f5eedd8a85102e488a. This commit makes it so aliases declared before the import of PSFzf won't be overwritten. Will that solve your issue?
Using New-Alias to avoid clobbering existing aliases would be good. but won't solve the issue here where fd
is an executable on the path rather than a predefined alias.
I think you'd need to check using Get-Command, e.g.
(Get-Command fd -ErrorAction SilentlyContinue) # fd exists, don't clobber it
Using New-Alias to avoid clobbering existing aliases would be good. but won't solve the issue here where
fd
is an executable on the path rather than a predefined alias.I think you'd need to check using Get-Command, e.g.
(Get-Command fd -ErrorAction SilentlyContinue) # fd exists, don't clobber it
Good point. I've updated PSFzf to use Get-Command. See release https://www.powershellgallery.com/packages/PSFzf/1.1.19.
Is there a way to prevent the module from importing certain aliases? In my case, specifically, the alias
fd
shadows thefd
command (the cool find command).Is the solution to do something like this? This doesn't seem very clean, as it might end up not removing the alias that was intended.