Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 26, 2019

PR Summary

When processing a file (implicitly or via -File), it looks at the remainings args and constructs parameters to pass to the pipeline. When the first character is a -, it assumes it's a parameter and uses the remainder to be the name of the parameter. If it's a single dash, it ends up being an empty string for the name. This causes the parameter binder to throw which then causes the console host to crash.

Fix is to detect that it's a single dash and pass that as an unnamed parameter which gets handled correctly.

PR Context

Fix #9362

PR Checklist

@TravisEz13 TravisEz13 added this to the 7.0.0-preview.1 milestone Apr 26, 2019
@TravisEz13 TravisEz13 added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Apr 26, 2019
@SteveL-MSFT
Copy link
Member Author

@PoshChan please retry linux, macos

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-Linux, PowerShell-CI-macOS

@TravisEz13 TravisEz13 merged commit d318e77 into PowerShell:master Apr 27, 2019
@iSazonov iSazonov assigned TravisEz13 and unassigned iSazonov Apr 27, 2019
@SteveL-MSFT SteveL-MSFT deleted the dash-arg branch April 29, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dash as a parameter crashes PWSH

4 participants