> The PATHEXT environment variable in PowerShell does not include .PS1 in
> the list, yet you can still run PowerShell scripts without typing the
> .PS1 extension on script files. I assume PowerShell ignores PATHEXT?
> Is there a way to force the user to enter the full name of a PowerShell
> script, including the extension, when running a script?
> The benefit is that the user will know they are running a script when
> they think they are running an EXE (e.g., a ping.ps1 script earlier in
> the PATH than ping.exe).
> Btw, will the extension be changed to .PS2 with the next version of
Well, you could consider adding a library or header to each script to
determine if it was called properly, if not, exit, or at least exit with
a message that looks like a real PowerShell generated error.