Title: Interactive input should works with -File parameter · Issue #9494 · PowerShell/PowerShell · GitHub
Open Graph Title: Interactive input should works with -File parameter · Issue #9494 · PowerShell/PowerShell
X Title: Interactive input should works with -File parameter · Issue #9494 · PowerShell/PowerShell
Description: Come form #9362 The comment in code says that interactive input should works with -File: PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs Lines 1133 to 1141 in ceed73d // Process interactive input......
Open Graph Description: Come form #9362 The comment in code says that interactive input should works with -File: PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs Lines 1133 to 1141 in...
X Description: Come form #9362 The comment in code says that interactive input should works with -File: PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs Lines 1133 to 1141 in...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9494
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Interactive input should works with -File parameter","articleBody":"Come form #9362\r\nThe comment in code says that interactive input should works\r\n- with -File:\r\nhttps://github.com/PowerShell/PowerShell/blob/ceed73d7375cb98a199ceb19796bb2311b0b0002/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs#L1133-L1141\r\n\r\n- with -Command:\r\nhttps://github.com/PowerShell/PowerShell/blob/ceed73d7375cb98a199ceb19796bb2311b0b0002/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs#L1296-L1304\r\n\r\nThe comments differ in \"no prompts\" vs \"with prompts\" - it is not clear is it comments and behaviors right.\r\n\r\nAlso using dash is documented only for `-Command` (`not for -File`)\r\nhttps://docs.microsoft.com/en-us/powershell/scripting/components/console/powershell.exe-command-line-help?view=powershell-6#-command\r\n\r\n \r\n# Steps to reproduce\r\n\r\n```powershell\r\npwsh -file C:\\temp\\q1.ps1 -\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\npwsh -file C:\\1\\q1.ps1 -\r\n\u003cwait interactive inout>\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\npwsh -file C:\\1\\q1.ps1 -\r\n-\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\npwsh -command -\r\n\u003cwait interactive inout>\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\n'-' was specified as the argument to -Command but standard input has not been redirected for this process.\r\n\r\nUsage: pwsh[.exe] [[-File] \u003cfilePath> [args]]\r\n [-Command { - | \u003cscript-block> [-args \u003carg-array>]\r\n | \u003cstring> [\u003cCommandParameters>] } ]\r\n [-ConfigurationName \u003cstring>] [-CustomPipeName \u003cstring>]\r\n [-EncodedCommand \u003cBase64EncodedCommand>]\r\n [-ExecutionPolicy \u003cExecutionPolicy>] [-InputFormat {Text | XML}]\r\n [-Interactive] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile]\r\n [-OutputFormat {Text | XML}] [-Version] [-WindowStyle \u003cstyle>]\r\n [-WorkingDirectory \u003cdirectoryPath>]\r\n\r\n pwsh[.exe] -h | -Help | -? | /?\r\n\r\nPowerShell Online Help https://aka.ms/pscore6-docs\r\n\r\nAll parameters are case-insensitive.\r\n-\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.0-rc.1\r\nPSEdition Core\r\nGitCommitId 6.2.0-rc.1-204-g262d86c691519ff7d5adacbae6424e2c87accce6\r\nOS Microsoft Windows 10.0.17763\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/iSazonov","@type":"Person","name":"iSazonov"},"datePublished":"2019-04-29T05:03:06Z","url":"https://github.com/PowerShell/PowerShell/issues/9494"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:42b2c890-7ad2-d511-5643-bd5d4a78334e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4AC:C35DD:25FAC96:34D5E5B:6AFD4305 |
| html-safe-nonce | d793d09e59ace9fb6134e8357c6930bd98b04c6a781182e02c79242281bf1af6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEFDOkMzNUREOjI1RkFDOTY6MzRENUU1Qjo2QUZENDMwNSIsInZpc2l0b3JfaWQiOiIyOTg5ODI3MTMxNDAxMTI2NjYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6f3e2c39f8efdabd935f1aea509dc9962f69fa7e3e5f5525fe4f6e6fa86b171b |
| hovercard-subject-tag | issue:438150787 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/9494/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e326838f460a6f76c304e72e67f8910a6e344652eac583d65bc700c8cb5dae66/PowerShell/PowerShell/issues/9494 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e326838f460a6f76c304e72e67f8910a6e344652eac583d65bc700c8cb5dae66/PowerShell/PowerShell/issues/9494 |
| og:image:alt | Come form #9362 The comment in code says that interactive input should works with -File: PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs Lines 1133 to 1141 in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iSazonov |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width