Repository: dotnet/runtime
File: eng/build.ps1 (PowerShell)

Code before:
foreach ($argument in $PSBoundParameters.Keys)
{
  switch($argument)
  {
    "runtimeConfiguration"   { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "runtimeFlavor"          { $arguments += " /p:RuntimeFlavor=$($PSBoundParameters[$argument].ToLowerInvariant())" }
    "usemonoruntime"         { $arguments += " /p:PrimaryRuntimeFlavor=Mono" }
    "librariesConfiguration" { $arguments += " /p:LibrariesConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "hostConfiguration"      { $arguments += " /p:HostConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "framework"              { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
    "os"                     { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" }
    "pack"                   { $arguments += " -pack /p:BuildAllConfigurations=true" }
    "properties"             { $arguments += " " + $properties }
    "verbosity"              { $arguments += " -$argument " + $($PSBoundParameters[$argument]) }
    "cmakeargs"              { $arguments += " /p:CMakeArgs=`"$($PSBoundParameters[$argument])`"" }
    # The -ninja switch is a no-op since Ninja is the default generator on Windows.
    "ninja"                  { }
    "msbuild"                { $arguments += " /p:Ninja=false" }
    "pgoinstrument"          { $arguments += " /p:PgoInstrument=$($PSBoundParameters[$argument])"}
    # configuration and arch can be specified multiple times, so they should be no-ops here
    "configuration"          {}
    "arch"                   {}
    "fsanitize"              { $arguments += " /p:EnableNativeSanitizers=$($PSBoundParameters[$argument])"}
    "useBootstrap"           { $arguments += " /p:UseBootstrap=$($PSBoundParameters[$argument])" }
    "clrinterpreter"         { $arguments += " /p:FeatureInterpreter=true" }
    "dynamiccodecompiled" { }
    default                  { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
  }
}

# Default dynamiccodecompiled based on target OS if not explicitly set
if (-not $dynamiccodecompiled) {
  if ($os -eq "maccatalyst" -or $os -eq "ios" -or $os -eq "iossimulator" -or $os -eq "tvos" -or $os -eq "tvossimulator" -or $os -eq "browser" -or $os -eq "wasi") {
    $dynamiccodecompiled = "false"
  } else {
    $dynamiccodecompiled = "true"
  }
}
$arguments += " /p:FeatureDynamicCodeCompiled=$dynamiccodecompiled"
if ($dynamiccodecompiled -eq "false") {
  $arguments += " /p:FeatureInterpreter=true"
}

if ($env:TreatWarningsAsErrors -eq 'false') {
  $arguments += " -warnAsError `$false"
}

# disable terminal logger for now: https://github.com/dotnet/runtime/issues/97211
$arguments += " /tl:false"
# disable line wrapping so that C&P from the console works well
$arguments += " /clp:ForceNoAlign"

Review comment (suggestion):
```suggestion
    "dynamiccodecompiled"    {}
```

Code after:
foreach ($argument in $PSBoundParameters.Keys)
{
  switch($argument)
  {
    "runtimeConfiguration"   { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "runtimeFlavor"          { $arguments += " /p:RuntimeFlavor=$($PSBoundParameters[$argument].ToLowerInvariant())" }
    "usemonoruntime"         { $arguments += " /p:PrimaryRuntimeFlavor=Mono" }
    "librariesConfiguration" { $arguments += " /p:LibrariesConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "hostConfiguration"      { $arguments += " /p:HostConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
    "framework"              { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
    "os"                     { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" }
    "pack"                   { $arguments += " -pack /p:BuildAllConfigurations=true" }
    "properties"             { $arguments += " " + $properties }
    "verbosity"              { $arguments += " -$argument " + $($PSBoundParameters[$argument]) }
    "cmakeargs"              { $arguments += " /p:CMakeArgs=`"$($PSBoundParameters[$argument])`"" }
    # The -ninja switch is a no-op since Ninja is the default generator on Windows.
    "ninja"                  { }
    "msbuild"                { $arguments += " /p:Ninja=false" }
    "pgoinstrument"          { $arguments += " /p:PgoInstrument=$($PSBoundParameters[$argument])"}
    # configuration and arch can be specified multiple times, so they should be no-ops here
    "configuration"          {}
    "arch"                   {}
    "fsanitize"              { $arguments += " /p:EnableNativeSanitizers=$($PSBoundParameters[$argument])"}
    "useBootstrap"           { $arguments += " /p:UseBootstrap=$($PSBoundParameters[$argument])" }
    "clrinterpreter"         { $arguments += " /p:FeatureInterpreter=true" }
    "dynamiccodecompiled"    {}
    default                  { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
  }
}

# Default dynamiccodecompiled based on target OS if not explicitly set
if (-not $dynamiccodecompiled) {
  if ($os -eq "maccatalyst" -or $os -eq "ios" -or $os -eq "iossimulator" -or $os -eq "tvos" -or $os -eq "tvossimulator" -or $os -eq "browser" -or $os -eq "wasi") {
    $dynamiccodecompiled = "false"
  } else {
    $dynamiccodecompiled = "true"
  }
}
$arguments += " /p:FeatureDynamicCodeCompiled=$dynamiccodecompiled"
if ($dynamiccodecompiled -eq "false") {
  $arguments += " /p:FeatureInterpreter=true"
}

if ($env:TreatWarningsAsErrors -eq 'false') {
  $arguments += " -warnAsError `$false"
}

# disable terminal logger for now: https://github.com/dotnet/runtime/issues/97211
$arguments += " /tl:false"
# disable line wrapping so that C&P from the console works well
$arguments += " /clp:ForceNoAlign"