Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSIC Read-Host returns $null when input is left empty #1790

Closed
PXCSW-TR opened this issue Mar 14, 2019 · 1 comment · Fixed by PowerShell/PowerShellEditorServices#1174
Closed
Assignees

Comments

@PXCSW-TR
Copy link

To help diagnose your issue, the following details are helpful:

  • Operating system name and version: Windows 10 1803 x64
  • VS Code version: 1.32.2 x64
  • PowerShell extension version; 1.11.0
  • Output from $PSVersionTable

System Details Output

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Return Value of Read-Host is $null when -Prompt is used and input is left empty

$value = Read-Host "Something"
Something:
$null -eq $value
True
$value = Read-Host -Prompt "Something"
Something:
$null -eq $value
True
$value = Read-Host

$value -eq ""
True

Expected Behaviour

Return Value is an empty string / ""

Actual Behaviour

Return Value is $null

Attached Logs

@SydneyhSmith
Copy link
Collaborator

@PXCSW-TR I am able to reproduce this, thanks for reporting the issue. This is likely happening because the extension uses a custom host--causing the weird behavior with the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants