Allow DSC parsing through OS architecture translation layers (#24852)

This commit is contained in:
Bob D
2025-02-24 13:50:42 -08:00
committed by GitHub
parent 462585a66b
commit c3fbd2c293
3 changed files with 5 additions and 24 deletions
@@ -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;
}