From 5a236f7d2f4fbdcc5ffc51d40222ba8cf6dc15ff Mon Sep 17 00:00:00 2001 From: Dan Thompson Date: Thu, 3 Oct 2019 17:18:58 -0700 Subject: [PATCH] Tweak help formatting script to be more `StrictMode` tolerant (#10563) --- .../FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs index bf3205a837..0dcf30c4cc 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs @@ -139,7 +139,8 @@ if (($_.relatedLinks -ne $()) -and ($_.relatedLinks.navigationLink -ne $()) -and var MamlParameterControl = CustomControl.Create() .StartEntry() .AddScriptBlockExpressionBinding( -@"$optional = $_.required -ne 'true' +@"Set-StrictMode -Off +$optional = $_.required -ne 'true' $positional = (($_.position -ne $()) -and ($_.position -ne '') -and ($_.position -notmatch 'named') -and ([int]$_.position -ne $())) $parameterValue = if ($null -ne $_.psobject.Members['ParameterValueGroup']) { "" {$($_.ParameterValueGroup.ParameterValue -join ' | ')}""