Separate DSC configuration parser check for ARM processor (#21395)

This commit is contained in:
David Kontyko
2024-04-22 16:03:42 -07:00
committed by GitHub
parent 4bcc3f41c0
commit fe38405b1d
2 changed files with 16 additions and 2 deletions
@@ -2984,8 +2984,8 @@ namespace System.Management.Automation.Language
Runspaces.Runspace.DefaultRunspace = localRunspace;
}
// Configuration is not supported on ARM or in ConstrainedLanguage
if (PsUtils.IsRunningOnProcessorArchitectureARM() || Runspace.DefaultRunspace?.ExecutionContext?.LanguageMode == PSLanguageMode.ConstrainedLanguage)
// Configuration is not supported in ConstrainedLanguage
if (Runspace.DefaultRunspace?.ExecutionContext?.LanguageMode == PSLanguageMode.ConstrainedLanguage)
{
if (SystemPolicy.GetSystemLockdownPolicy() != SystemEnforcementMode.Audit)
{
@@ -3004,6 +3004,17 @@ namespace System.Management.Automation.Language
dropIntoDebugger: true);
}
// Configuration is not supported on ARM64
if (PsUtils.IsRunningOnProcessorArchitectureARM())
{
ReportError(
configurationToken.Extent,
nameof(ParserStrings.ConfigurationNotAllowedOnArm64),
ParserStrings.ConfigurationNotAllowedOnArm64,
configurationToken.Kind.Text());
return null;
}
// Configuration is not supported on WinPE
if (Utils.IsWinPEHost())
{
@@ -1370,4 +1370,7 @@ ModuleVersion : Version of module to import. If used, ModuleName must represent
<data name="WDACGetSteppablePipelineLogMessage" xml:space="preserve">
<value>Creating a steppable pipeline from a script block may require evaluating some expressions within the script block. The expression evaluation will silently fail and return 'null' in Constrained Language mode, unless the expression represents a constant value.</value>
</data>
<data name="ConfigurationNotAllowedOnArm64" xml:space="preserve">
<value>Configuration keyword is not supported on ARM64 processors.</value>
</data>
</root>