-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.
Description
Summary of the new feature / enhancement
For CoreClr, we have 4 platform Windows, MacOS, Linux and FreeBSD in a PR
| Variable | Description | PowerShell | dotnet API |
|---|---|---|---|
| IsCoreClr | Platform.IsCoreClr | true | |
| IsWindows | Platform.IsWindows | OperatingSystem.IsWindows() | |
| IsLinux | Platform.IsLinux | OperatingSystem.IsLinux() | |
| IsMacOS | Platform.IsMacOS | OperatingSystem.IsMacOS() | |
| IsFreeBSD | PR20041 | Platform.IsFreeBSD | OperatingSystem.IsFreeBSD() |
For net9.0, we have more platforms herited from MonoEngine and compatible with the Microsoft.PowerShell.Sdk
Based on the System.OperatingSystem Methods and the RidGraph, we should add the following platforms and variables :
| Variable | Description | PowerShell | dotnet API |
|---|---|---|---|
| IsMonoRuntime | dotnet/Mono | Platform.IsMonoRuntime | typeof(object).Assembly.GetType("Mono.RuntimeStructs") != null; |
| IsBrowser | dotnet/Browser-Wasm Blazor Wasm | Platform.IsBrowser | OperatingSystem.IsBrowser() |
| IsWasi | dotnet/Wasi-Wasm | Platform.IsWasi | OperatingSystem.IsWasi() |
| IsAndroid | dotnet/Android + termux-packages + Avalonia + MAUI | Platform.IsAndroid | OperatingSystem.IsAndroid() |
Proposed technical implementation details (optional)
Step 1
- Add all the missing platforms PR/24934
Step 2
- Add each global variable Is*
OR - Stop declaring Is* variables and move to another syntax like a PSDrive $is:Windows or a hashtable $Is.Windows
RokeJulianLockhart and kasini3000
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.