Add PowerShell variables corresponding to platform

This deprecates the Microsoft.PowerShell.Platform module and ensure that
IsLinux/OSX/Windows/Core variables are defined all throughout PowerShell.
This commit is contained in:
Andrew Schwartzmeyer
2016-04-08 15:04:27 -07:00
parent 49066d212a
commit a082a02e6c
2 changed files with 40 additions and 0 deletions
@@ -5101,6 +5101,32 @@ end
RemotingErrorIdStrings.PSSessionAppName,
ScopedItemOptions.None),
// End: Variables which control remoting behavior
#region Platform
new SessionStateVariableEntry(
SpecialVariables.IsLinux,
Platform.IsLinux,
String.Empty,
ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope),
new SessionStateVariableEntry(
SpecialVariables.IsOSX,
Platform.IsOSX,
String.Empty,
ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope),
new SessionStateVariableEntry(
SpecialVariables.IsWindows,
Platform.IsWindows,
String.Empty,
ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope),
new SessionStateVariableEntry(
SpecialVariables.IsCore,
Platform.IsCore,
String.Empty,
ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope),
#endregion
};
/// <summary>
@@ -156,6 +156,20 @@ namespace System.Management.Automation
internal const string PSModuleAutoLoading = "PSModuleAutoLoadingPreference";
internal static VariablePath PSModuleAutoLoadingPreferenceVarPath = new VariablePath("global:" + PSModuleAutoLoading);
#region Platform Variables
internal const string IsLinux = "IsLinux";
internal static VariablePath IsLinuxPath = new VariablePath("IsLinux");
internal const string IsOSX = "IsOSX";
internal static VariablePath IsOSXPath = new VariablePath("IsOSX");
internal const string IsWindows = "IsWindows";
internal static VariablePath IsWindowsPath = new VariablePath("IsWindows");
internal const string IsCore = "IsCore";
internal static VariablePath IsCorePath = new VariablePath("IsCore");
#endregion
#region Preference Variables
internal const string DebugPreference = "DebugPreference";