Skip to content

Interactive input should works with -File parameter #9494

@iSazonov

Description

@iSazonov

Come form #9362
The comment in code says that interactive input should works

The comments differ in "no prompts" vs "with prompts" - it is not clear is it comments and behaviors right.

Also using dash is documented only for -Command (not for -File)
https://docs.microsoft.com/en-us/powershell/scripting/components/console/powershell.exe-command-line-help?view=powershell-6#-command

Steps to reproduce

pwsh -file C:\temp\q1.ps1 -

Expected behavior

pwsh -file C:\1\q1.ps1 -
<wait interactive inout>

Actual behavior

pwsh -file C:\1\q1.ps1 -
-

Expected behavior

pwsh -command -
<wait interactive inout>

Actual behavior

'-' was specified as the argument to -Command but standard input has not been redirected for this process.

Usage: pwsh[.exe] [[-File] <filePath> [args]]
                  [-Command { - | <script-block> [-args <arg-array>]
                                | <string> [<CommandParameters>] } ]
                  [-ConfigurationName <string>] [-CustomPipeName <string>]
                  [-EncodedCommand <Base64EncodedCommand>]
                  [-ExecutionPolicy <ExecutionPolicy>] [-InputFormat {Text | XML}]
                  [-Interactive] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile]
                  [-OutputFormat {Text | XML}] [-Version] [-WindowStyle <style>]
                  [-WorkingDirectory <directoryPath>]

       pwsh[.exe] -h | -Help | -? | /?

PowerShell Online Help https://aka.ms/pscore6-docs

All parameters are case-insensitive.
-

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.0-rc.1
PSEdition                      Core
GitCommitId                    6.2.0-rc.1-204-g262d86c691519ff7d5adacbae6424e2c87accce6
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions