mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Allow DSC parsing through OS architecture translation layers (#24852)
This commit is contained in:
@@ -2054,25 +2054,6 @@ $result
|
||||
return !allDigits;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// System Restore APIs are not supported on the ARM platform. Skip the system restore operation is necessary.
|
||||
/// </summary>
|
||||
/// <param name="cmdlet"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool SkipSystemRestoreOperationForARMPlatform(PSCmdlet cmdlet)
|
||||
{
|
||||
bool retValue = false;
|
||||
if (PsUtils.IsRunningOnProcessorArchitectureARM())
|
||||
{
|
||||
var ex = new InvalidOperationException(ComputerResources.SystemRestoreNotSupported);
|
||||
var er = new ErrorRecord(ex, "SystemRestoreNotSupported", ErrorCategory.InvalidOperation, null);
|
||||
cmdlet.WriteError(er);
|
||||
retValue = true;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes the Win32Shutdown command on provided target computer using WSMan
|
||||
/// over a CIMSession. The flags parameter determines the type of shutdown operation
|
||||
|
||||
@@ -3004,8 +3004,8 @@ namespace System.Management.Automation.Language
|
||||
dropIntoDebugger: true);
|
||||
}
|
||||
|
||||
// Configuration is not supported on ARM64
|
||||
if (PsUtils.IsRunningOnProcessorArchitectureARM())
|
||||
// Configuration is not supported for ARM or ARM64 process architecture.
|
||||
if (PsUtils.IsRunningOnProcessArchitectureARM())
|
||||
{
|
||||
ReportError(
|
||||
configurationToken.Extent,
|
||||
|
||||
@@ -74,12 +74,12 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return true/false to indicate whether the processor architecture is ARM.
|
||||
/// Return true/false to indicate whether the process architecture is ARM.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal static bool IsRunningOnProcessorArchitectureARM()
|
||||
internal static bool IsRunningOnProcessArchitectureARM()
|
||||
{
|
||||
Architecture arch = RuntimeInformation.OSArchitecture;
|
||||
Architecture arch = RuntimeInformation.ProcessArchitecture;
|
||||
return arch == Architecture.Arm || arch == Architecture.Arm64;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user