Skip to content

We have $PSEdition, so shall "$IsWindows , $IsLinux , $IsOSX , and $IsCore" be kept in PowerShell Core permanently? #1280

Closed

Description

The variables $IsWindows , $IsLinux , $IsOSX , and $IsCore are now an integral part of PowerShell Core. $PSEdition serves the same purpose in PS Core, so shall the "$is" variables be kept permanently in PowerShell Core?

We should nail down this as early as possible, because existing tests are using the "$is" variables a lot, and new tests would follow the same pattern. It will be more work to clean them up if we decide to remove "$is" variables later.

PS C:> $PSEdition
Core
PS C:>

Activity

  1. andyleejordan commented on Jul 5, 2016

    @andyleejordan
    Member

    For simplicity, I would say yes. They map directly to the .NET Core APIs.

    /cc James Truher (@JamesWTruher)

  2. daxian-dbw commented on Jul 5, 2016

    @daxian-dbw
    MemberAuthor
  3. lzybkr commented on Jul 5, 2016

    @lzybkr
    Contributor

    The variables are concise, I like that.

    Mapping to an api isn't important, especially since the variables should be compile time constants, so for example we can do simple constant propagation while generating code.

    I'd vote for going public with the $Is* variables and letting the community convince us it was a bad choice.

  4. added
    Issue-Question
    Usability
    WG-Language
    on Jul 5, 2016
  5. HemantMahawar commented on Jul 6, 2016

    @HemantMahawar
    Contributor

    I get & like the $IsWindows , $IsLinux , $IsOSX variables as they imply the OS flavor. But $IsCore doesn't seems to fit the bill ... if it is supposed to be about PowerShell on core CLR, then we should use $PSVersion.PSEdition. ... fyi Joey Aiello (@joeyaiello) Bruce Payette (@BrucePay) @KrishnaV-MSFT

  6. changed the title [-]We have $PSEdition, so shall "$IsWindows , $IsLinux , $IsOSX , and $IsCore" be kept in OPS permanently?[/-] [+]We have $PSEdition, so shall "$IsWindows , $IsLinux , $IsOSX , and $IsCore" be kept in PowerShell permanently?[/+] on Aug 16, 2016
  7. 18 remaining items

  8. modified the milestone: on May 15, 2017
  9. joeyaiello commented on May 22, 2017

    @joeyaiello
    Contributor

    I still need to write more RFCs....fun....

  10. added
    Review - Committee
    and removed
    Committee-Reviewed
    on Aug 29, 2017
  11. SteveL-MSFT commented on Aug 29, 2017

    @SteveL-MSFT
    Member

    Since it doesn't appear that the RFC is going to make it for 6.0.0, I'd like to revisit one aspect of this which is renaming $IsOSX to $IsMacOS for consistency (which may also mean renaming our Mac release filename).

  12. joeyaiello commented on Aug 29, 2017

    @joeyaiello
    Contributor

    Yeah, we should probably move to macOS. We can leave the old one there as an alias too, right? Just make them resolve to the same thing? As for casing, I'm pretty hardcore about 'macOS', but capital M seems the right thing to do here.

  13. SteveL-MSFT commented on Aug 29, 2017

    @SteveL-MSFT
    Member

    Created a separate issue for $IsOSX->$IsmacOS
    #4700

  14. added
    Committee-Reviewed
    and removed
    Review - Committee
    on Aug 29, 2017
  15. JamesWTruher commented on Aug 31, 2017

    @JamesWTruher
    Collaborator

    we don't have a backward compatibility problem yet as this variable doesn't exist in 5x and we haven't released yet. I would rather not carry around state variables where we don't need to and while removing $IsOSX now may be a large PR because of the test changes, better now than after we release.

  16. SteveL-MSFT commented on Jul 22, 2018

    @SteveL-MSFT
    Member

    No longer an issue. What exists will exist forever at this point for these automatic variables.

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

Metadata

Metadata

Labels

Committee-ReviewedIssue-QuestionResolution-AnsweredWG-Language

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions