Skip to content

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

Open

Description

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.

Activity

  1. Satak commented on Nov 23, 2020

    @Satak

    Still problem with the ? ternary operator

    image

    Fix coming soon?

  2. TylerLeonhardt commented on Nov 23, 2020

    @TylerLeonhardt
    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.

  3. Satak commented on Nov 23, 2020

    @Satak

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

  4. Satak commented on Nov 23, 2020

    @Satak

    image

  5. daxian-dbw commented on Nov 23, 2020

    @daxian-dbw
    MemberAuthor

    Sami Koskivaara (@Satak) What version of PowerShell are you using?

  6. Satak commented on Nov 23, 2020

    @Satak

    Sami Koskivaara (@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?

  7. TylerLeonhardt commented on Nov 24, 2020

    @TylerLeonhardt
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions