that's actually a built-in alias to PowerShell itself. It can be removed but otherwise it's best to be explicit when calling an executable. Unfortunate conflict but it's been there forever and would break things if it was removed now by default (you can remove it as part of your script or profile)
@pingzing.xyz a possible workaround for you would be to install and use `which.exe` for finding exe file paths, and uninstall `where.exe`. That would eliminate the conflict without losing any functionality.
While I personally agree, `where` and `foreach` specifically are not as unanimous in the community. There's a not insignificant group of folks who believe they should be treated more like keywords, and using the full command name is less readable.
(Again, not me, just saying it's not as clear cut)
There is a time to be principled and a time to be pragmatic.
On this one, we went with principle - a fully consistent model.
I assumed that the community would not shy away from aliases the way they have and would use them where they made sense.
In retrospect, I should have hardwired those
So I mention it only because it is much harder to completely write off when a decent chunk of folks do it regardless of what any one individual thinks. You can use github code search to gauge usage of each
I'm definitely not suggesting the proliferation of the style choice, but I would also strongly recommend against someone removing said aliases in their profile.
Sounds like a nice feature to have! If you know where the source code for that module is kept, you could probably score some points by submitting a quick PR.
Thought about it. Last release was 2016, and last commit was 2020 (which never saw a release), so I may save it for a day when I've got more spoons to burn
Comments
(Again, not me, just saying it's not as clear cut)
Hey @jsnover.com, huge fan here. I owe a significant part of my career success to PowerShell, so thank you for creating it! 😊
Any thoughts on whether `where` and `foreach` should be treated as official keywords and used in production code?
On this one, we went with principle - a fully consistent model.
I assumed that the community would not shy away from aliases the way they have and would use them where they made sense.
In retrospect, I should have hardwired those
path:*.ps1 /\|\s*where [{a-zA-Z\-]/
path:*.ps1 /\|\s*where-object [{a-zA-Z\-]/
(NPM completions in the shell)
Might be worth contacting the module's dev and asking if it's abandoned or just idle for the moment. Could help you decide whether to fork, PR, etc.