You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
We have $PSEdition, so shall "$IsWindows , $IsLinux , $IsOSX , and $IsCore" be kept in PowerShell Core permanently? #1280
Committee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.WG-Languageparser, language semantics
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.
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.
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
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
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).
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.
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.
Committee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.WG-Languageparser, language semantics
Activity
andyleejordan commentedon Jul 5, 2016
For simplicity, I would say yes. They map directly to the .NET Core APIs.
/cc James Truher (@JamesWTruher)
daxian-dbw commentedon Jul 5, 2016
Jason Shirk (@lzybkr) sergei (@vors) Hemant Mahawar (@HemantMahawar) SandeepSutari Mike Richmond (@mirichmo) Can you guys please comment?
lzybkr commentedon Jul 5, 2016
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.
HemantMahawar commentedon Jul 6, 2016
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
[-]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?[/+]18 remaining items
joeyaiello commentedon May 22, 2017
I still need to write more RFCs....fun....
SteveL-MSFT commentedon Aug 29, 2017
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).
joeyaiello commentedon Aug 29, 2017
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.
SteveL-MSFT commentedon Aug 29, 2017
Created a separate issue for $IsOSX->$IsmacOS
#4700
JamesWTruher commentedon Aug 31, 2017
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.
SteveL-MSFT commentedon Jul 22, 2018
No longer an issue. What exists will exist forever at this point for these automatic variables.