Prerequisites
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 Console
Error details
Environment 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.1
Visuals
No response
Prerequisites
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.execommandsftypeandassfoc, the script extension (for example.plfor Perl scripts), this extension must be listed in thePATHEXTenvironment 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 inPATHEXT, 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
Visuals
No response