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
{{ message }}
Repository navigation
Should non-windows system users be required to include the extension when executing scripts? #1044
Assume that I have written a script which is a paragon of portability. It runs on all the platforms without modification, and is in my PATH. On Windows, I type: PS> Hello
and it executes!
should I be able to do the same on non-windows platforms? Note that I have not typed the actual name of the file on Windows (which is hello.ps1), just hello.
#!powershell does not address this issue, because it doesn't change the name of the script. Are we going to suggest that our users create 2 copies of the same file: hello and hello.ps1
one for Windows, another for not?
are we going to require our users to type hello.ps1 on non-Windows platforms?
I suggest that we support our current behavior on non-Windows platforms, we supply the .ps1, and use the same disambiguation logic that we do for .cmd, .exe, etc, which an additional which is no extension. This way if files (on non-windows)
hello
hello.ps1
we would execute hello. similar to what we would do if we foundhello.exeon windows
If we find only hello.ps1, and the user types hello, we run it and not require the user to type the actual filename
Activity