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

Possible updates for the new ternary operator added in PowerShell language #184

Open
daxian-dbw opened this issue Aug 19, 2019 · 7 comments

Comments

@daxian-dbw
Copy link
Member

The ternary operator will soon be added to the PowerShell language, which may cause syntax colorization issue.
Open this issue to track the possible changes needed in this repo.

@Satak
Copy link

Satak commented Nov 23, 2020

Still problem with the ? ternary operator

image

Fix coming soon?

@TylerLeonhardt
Copy link
Member

Do you have the ternary operator on the same line as the expression?

$true ? "f" : "s" 

Vs

$true
? "f" : "s"

It has to be on the same line.

@Satak
Copy link

Satak commented Nov 23, 2020

it's like this $true ? "f" : "s"

@Satak
Copy link

Satak commented Nov 23, 2020

image

@daxian-dbw
Copy link
Member Author

@Satak What version of PowerShell are you using?

@Satak
Copy link

Satak commented Nov 23, 2020

@Satak What version of PowerShell are you using?

Sorry my bad. I just realized that the default PS is set to 5.1 at VS Code. I have installed 7.1 to my machine and after switching Powershell to 7.1 it works. Is there a place to set the default PS to 7.1 in VS Code?

@TylerLeonhardt
Copy link
Member

Do you see the version number at the bottom right when you have a PowerShell file open?
image

If you click on that, you can set which version you want to use. That will set the default.

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

No branches or pull requests

3 participants