-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Extensions of non-PowerShell scripts (such as .pl for Perl scripts etc.) must be listed in PATHEXT in order for the script to be run in the same console. #15854
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
When trying to run a non-PowerShell script whose filename extension is associated with a script interpreter, for example using the cmd.exe commands ftype and assfoc, the script extension (for example .pl for Perl scripts), this extension must be listed in the PATHEXT environment variable in order for this script to be run in the same console as the one from which the script was started (if the script is started without specifying the interpreter executable). If this extension is not listed in PATHEXT, PowerShell will open a new console and run the script in this new console. (See also this Stackoverflow question and its accepted answer).
Expected behavior
I would have expected the script to be run in the current console regardless of its extension being listed in `PATHEXT`.Actual behavior
Executing the script opens a new ConsoleError details
noneEnvironment data
Name Value
---- -----
PSVersion 5.1.19041.1023
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1023
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Visuals
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime