PowerShell/test
Steve Lee 89db7505d6 Have console host not enter command prompt mode when using Read-Host -Prompt (#9743)
`Read-Host` calls into `$Host.UI.Prompt()`.  However, this method is also used when the host prompts for mandatory parameters that aren't provided.  The method expects to be called when given a `FieldDescription` and if the input starts with `!` it enters `CommandPromptMode`.  In this mode, you can type `!?` to request help, for example.  However this mode is not something you can use via `Read-Host` (only if calling `$Host.UI.Prompt()` directly passing in a well constructed `FieldDescription`).  When using `Read-Host -Prompt`, the cmdlet creates a `FieldDescription` where the name is the prompt and the rest of the properties are empty.

The fix is that if `Label` is empty, we can assume it's being called from `Read-Host` rather than being called to prompt for a mandatory parameter and thus not enter `CommandPromptMode`.
2019-06-09 07:55:11 -07:00
..
common/markdown Build(deps): Bump gulp from 4.0.1 to 4.0.2 in /test/common/markdown (#9544) 2019-05-10 10:07:22 -07:00
docker/networktest Update use of "PowerShell Core" to just "PowerShell" (#9513) 2019-05-10 15:34:27 -07:00
hosting Merged PR 8512: Update version for SDK tests and Microsoft.PowerShell.Native package 2019-05-24 20:17:45 +00:00
packaging/windows Update use of "PowerShell Core" to just "PowerShell" (#9513) 2019-05-10 15:34:27 -07:00
powershell Have console host not enter command prompt mode when using Read-Host -Prompt (#9743) 2019-06-09 07:55:11 -07:00
shebang Reorganize tests 2016-01-14 17:00:06 -08:00
tools Fix minor style issues come from last commits (#9640) 2019-06-07 08:35:33 +05:00
xUnit Cleanup unused pinvokes on unix (#9531) 2019-05-07 10:22:01 +05:00
README.md Move xUnit tests in new folder (#8356) 2018-12-13 14:22:07 -08:00
Test.Common.props Port PowerShell to .NET Core 3.0 (#9597) 2019-05-21 13:43:51 +08:00

Testing

The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./xUnit. The third-party shebang test is in ./shebang.