mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Replace IsX method with IsCore property
This commit is contained in:
@@ -68,16 +68,16 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
// true if cross-platform (always for this project)
|
||||
internal static bool IsX()
|
||||
public static const bool IsCore
|
||||
{
|
||||
#if CORECLR
|
||||
// CoreCLR version is cross-platform
|
||||
return true;
|
||||
#else
|
||||
// FullCLR is not cross-platform
|
||||
return false;
|
||||
#endif
|
||||
get
|
||||
{
|
||||
#if CORECLR
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// format files
|
||||
@@ -115,7 +115,7 @@ namespace System.Management.Automation
|
||||
|
||||
internal static bool UsesCodeSignedAssemblies()
|
||||
{
|
||||
return !Platform.IsX();
|
||||
return !Platform.IsCore;
|
||||
}
|
||||
|
||||
// This is mainly with respect to the auto-mounting of
|
||||
|
||||
+1
-1
@@ -1810,7 +1810,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
|
||||
// optional pre-load and binding verification
|
||||
// Porting Note: DLL.resources are not currently available on Linux
|
||||
if (!Platform.IsX() && this.VerifyStringResources)
|
||||
if (!Platform.IsCore && this.VerifyStringResources)
|
||||
{
|
||||
DisplayResourceManagerCache.LoadingResult result;
|
||||
DisplayResourceManagerCache.AssemblyBindingStatus bindingStatus;
|
||||
|
||||
@@ -1323,7 +1323,7 @@ namespace System.Management.Automation
|
||||
|
||||
// Close the progress pane that may have popped up from analyzing UNC paths.
|
||||
// Porting note: we don't like this message
|
||||
if (!Platform.IsX() && context.CurrentCommandProcessor != null)
|
||||
if (!Platform.IsCore && context.CurrentCommandProcessor != null)
|
||||
{
|
||||
ProgressRecord analysisProgress = new ProgressRecord(0, Modules.ScriptAnalysisPreparing, " ");
|
||||
analysisProgress.RecordType = ProgressRecordType.Completed;
|
||||
|
||||
@@ -5648,7 +5648,7 @@ if($paths) {
|
||||
// Porting note: the snapins still require 'ProcessorArchitecture=MSIL' in
|
||||
// the strong name, which is not in the strong name of assemblies created
|
||||
// by dotnet-cli
|
||||
if (!Platform.IsX() &&
|
||||
if (!Platform.IsCore &&
|
||||
!string.Equals(assemblyName.FullName, psSnapInInfo.AssemblyName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string message = StringUtil.Format(ConsoleInfoErrorStrings.PSSnapInAssemblyNameMismatch, psSnapInInfo.AbsoluteModulePath, psSnapInInfo.AssemblyName);
|
||||
|
||||
@@ -763,7 +763,7 @@ namespace System.Management.Automation
|
||||
|
||||
// Porting note: Open PowerShell has a Modules folder in the the application base path which contains the built-in modules
|
||||
// It must be in the front of the path no matter what.
|
||||
if (Platform.IsX())
|
||||
if (Platform.IsCore)
|
||||
{
|
||||
currentProcessModulePath = AddToPath(currentProcessModulePath, GetSystemwideModulePath(), 0);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace System.Management.Automation
|
||||
// TODO:PSL this is a workaround since the exception below
|
||||
// hides the internal issue of what's going on in terms of
|
||||
// execution policy.
|
||||
if (Platform.IsX())
|
||||
if (Platform.IsCore)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace System.Management.Automation
|
||||
/// </exception>
|
||||
internal static string GetApplicationBase(string shellId)
|
||||
{
|
||||
if (!Platform.IsX())
|
||||
if (!Platform.IsCore)
|
||||
{
|
||||
// try to get the path from the registry first
|
||||
string result = GetApplicationBaseFromRegistry(shellId);
|
||||
@@ -305,7 +305,7 @@ namespace System.Management.Automation
|
||||
|
||||
// And built-in modules
|
||||
string progFileDir;
|
||||
if (Platform.IsX())
|
||||
if (Platform.IsCore)
|
||||
{
|
||||
progFileDir = Path.Combine(appBase, "Modules");
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace System.Management.Automation
|
||||
|
||||
// There is no signature support on non-Windows platforms (yet), when
|
||||
// execution reaches here, we are sure the file is under product folder
|
||||
if (Platform.IsX())
|
||||
if (Platform.IsCore)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user