8000 Do not generate clean block in proxy function when the feature is dis… · PowerShell/PowerShell@7cc9c87 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cc9c87

Browse files
authored
Do not generate clean block in proxy function when the feature is disabled (#17112)
1 parent 5e37308 commit 7cc9c87

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/System.Management.Automation/engine/CommandMetadata.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,15 @@ internal string GetProxyCommand(string helpComment, bool generateDynamicParamete
864864
", GetDynamicParamBlock());
865865
}
866866

867+
string cleanBlock = string.Empty;
868+
if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSCleanBlockFeatureName))
869+
{
870+
cleanBlock = string.Format(CultureInfo.InvariantCulture, @"
871+
clean
872+
{{{0}}}
873+
", GetCleanBlock());
874+
}
875+
867876
string result = string.Format(CultureInfo.InvariantCulture, @"{0}
868877
param({1})
869878
@@ -875,9 +884,7 @@ internal string GetProxyCommand(string helpComment, bool generateDynamicParamete
875884
876885
end
877886
{{{5}}}
878-
879-
clean
880-
{{{6}}}
887+
{6}
881888
<#
882889
{7}
883890
#>
@@ -888,7 +895,7 @@ internal string GetProxyCommand(string helpComment, bool generateDynamicParamete
888895
GetBeginBlock(),
889896
GetProcessBlock(),
890897
GetEndBlock(),
891-
GetCleanBlock(),
898+
cleanBlock,
892899
CodeGeneration.EscapeBlockCommentContent(helpComment));
893900

894901
return result;

0 commit comments

Comments
 (0)
0