Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,11 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo(
.EndEntry()
.EndControl();

var control6 = CustomControl.Create()
.StartEntry()
.AddText(StringUtil.Format("[{0}]", HelpDisplayStrings.CommonWorkflowParameters))
.EndEntry()
.EndControl();

var control5 = CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"name")
.AddText(" ")
.AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: sharedControls[1])
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.WorkflowCommonParameters -eq $true", customControl: control6)
.AddText(" ")
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.CommonParameters -eq $true", customControl: control7)
.AddNewline()
.AddNewline()
Expand Down Expand Up @@ -340,18 +332,6 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.EndEntry()
.EndControl();

var control15 = CustomControl.Create()
.StartEntry()
.AddText(HelpDisplayStrings.CommonWorkflowParameters)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddText(HelpDisplayStrings.BaseWorkflowCmdletInformation)
.EndFrame()
.AddNewline()
.AddNewline()
.EndEntry()
.EndControl();

var control14 = CustomControl.Create()
.StartEntry()
.AddText("-")
Expand All @@ -376,21 +356,11 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.EndEntry()
.EndControl();

var control11 = CustomControl.Create()
.StartEntry()
.AddText("[")
.AddText(HelpDisplayStrings.CommonWorkflowParameters)
.AddText("]")
.EndEntry()
.EndControl();

var control10 = CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"name")
.AddText(" ")
.AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: sharedControls[1])
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.WorkflowCommonParameters -eq $true", customControl: control11)
.AddText(" ")
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.CommonParameters -eq $true", customControl: control12)
.AddNewline()
.AddNewline()
Expand Down Expand Up @@ -429,7 +399,6 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"Parameters", customControl: control13)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.WorkflowCommonParameters -eq $true", customControl: control15)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.CommonParameters -eq $true", customControl: control16)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "($_.CommonParameters -eq $false) -and ($_.parameters.parameter.count -eq 0)", customControl: control17)
.EndFrame()
Expand Down Expand Up @@ -499,18 +468,6 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.EndEntry()
.EndControl();

var control29 = CustomControl.Create()
.StartEntry()
.AddText(HelpDisplayStrings.CommonWorkflowParameters)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddText(HelpDisplayStrings.BaseWorkflowCmdletInformation)
.EndFrame()
.AddNewline()
.AddNewline()
.EndEntry()
.EndControl();

var control28 = CustomControl.Create()
.StartEntry()
.AddText(HelpDisplayStrings.NamedParameter)
Expand Down Expand Up @@ -584,21 +541,11 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.EndEntry()
.EndControl();

var control21 = CustomControl.Create()
.StartEntry()
.AddText("[")
.AddText(HelpDisplayStrings.CommonWorkflowParameters)
.AddText("]")
.EndEntry()
.EndControl();

var control20 = CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"name")
.AddText(" ")
.AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: sharedControls[1])
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.WorkflowCommonParameters -eq $true", customControl: control21)
.AddText(" ")
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.CommonParameters -eq $true", customControl: control22)
.AddNewline()
.AddNewline()
Expand Down Expand Up @@ -637,7 +584,6 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ExtendedCmdletHelpInfo_
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"Parameters", customControl: control23)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.WorkflowCommonParameters -eq $true", customControl: control29)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "$_.CommonParameters -eq $true", customControl: control30)
.AddScriptBlockExpressionBinding(@" ", selectedByScript: "($_.CommonParameters -eq $false) -and ($_.parameters.parameter.count -eq 0)", customControl: control31)
.AddNewline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
.EndEntry()
.EndControl();

var CommonWorkflowParametersControl = CustomControl.Create()
.StartEntry()
.AddScriptBlockExpressionBinding(StringUtil.Format(@"$wfp = $_.psobject.Properties['WorkflowCommonParameters']
if ($null -ne $wfp -and $wfp.Value)
{{
'[{0}] '
}}", HelpDisplayStrings.CommonWorkflowParameters))
.EndEntry()
.EndControl();

var RelatedLinksHelpInfoControl = CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
Expand Down Expand Up @@ -270,7 +260,6 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
.AddPropertyExpressionBinding(@"name")
.AddText(" ")
.AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: MamlParameterControl)
.AddCustomControlExpressionBinding(CommonWorkflowParametersControl)
.AddText("[" + HelpDisplayStrings.CommonParameters + "]")
.AddNewline(2)
.EndEntry()
Expand Down Expand Up @@ -413,7 +402,6 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
MamlPossibleValueControl,
MamlTrueFalseShortControl,
MamlIndentedSyntaxControl,
CommonWorkflowParametersControl,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry is with the index 16 in the array sharedControls, so for an index that is greater than 16, we need to adjust it by subtracting 1. This is why you will see many index changes below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could leave null in this entry.
In another PR - you could introduce names for each shared control to make the file more friendly to human editing now that we no longer use a tool to generate it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in a separate PR #6712

MamlSyntaxControl,
MamlTypeWithDescriptionControl,
RelatedLinksHelpInfoControl,
Expand Down Expand Up @@ -578,7 +566,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo(Cus
.AddText(HelpDisplayStrings.RelatedLinks)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[19])
.EndFrame()
.AddNewline()
.AddText(HelpDisplayStrings.RemarksSection)
Expand All @@ -597,7 +585,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo(Cus
.AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -full""")
.AddText(@""".")
.AddNewline()
.AddCustomControlExpressionBinding(sharedControls[19])
.AddCustomControlExpressionBinding(sharedControls[18])
.EndFrame()
.EndEntry()
.EndControl());
Expand Down Expand Up @@ -634,7 +622,6 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Det
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"Parameters", customControl: control9)
.AddCustomControlExpressionBinding(sharedControls[16])
.AddText(HelpDisplayStrings.CommonParameters)
.AddNewline()
.StartFrame(leftIndent: 4)
Expand Down Expand Up @@ -664,7 +651,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Det
.AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -full""")
.AddText(@""".")
.AddNewline()
.AddCustomControlExpressionBinding(sharedControls[19])
.AddCustomControlExpressionBinding(sharedControls[18])
.EndFrame()
.EndEntry()
.EndControl());
Expand Down Expand Up @@ -711,7 +698,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Ful
.AddText(HelpDisplayStrings.NonHyphenTerminatingErrors)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"nonTerminatingError", enumerateCollection: true, customControl: sharedControls[21])
.AddPropertyExpressionBinding(@"nonTerminatingError", enumerateCollection: true, customControl: sharedControls[20])
.EndFrame()
.EndEntry()
.EndControl();
Expand All @@ -721,20 +708,20 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Ful
.AddText(HelpDisplayStrings.TerminatingErrors)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[21])
.AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[20])
.EndFrame()
.EndEntry()
.EndControl();

var control12 = CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[18])
.AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[17])
.EndEntry()
.EndControl();

var control11 = CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"InputType", enumerateCollection: true, customControl: sharedControls[18])
.AddPropertyExpressionBinding(@"InputType", enumerateCollection: true, customControl: sharedControls[17])
.EndEntry()
.EndControl();

Expand All @@ -747,7 +734,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Ful
.AddText(HelpDisplayStrings.Parameters)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"Parameters", customControl: sharedControls[23])
.AddPropertyExpressionBinding(@"Parameters", customControl: sharedControls[22])
.EndFrame()
.AddText(HelpDisplayStrings.InputType)
.AddNewline()
Expand Down Expand Up @@ -778,7 +765,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Ful
.AddText(HelpDisplayStrings.RelatedLinks)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[19])
.EndFrame()
.EndEntry()
.EndControl());
Expand Down Expand Up @@ -946,7 +933,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_ProviderHelpInfo(Custom
.AddText(HelpDisplayStrings.RelatedLinks)
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
.AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[19])
.EndFrame()
.EndEntry()
.EndControl());
Expand Down Expand Up @@ -1085,7 +1072,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Par
CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
.AddCustomControlExpressionBinding(sharedControls[23])
.AddCustomControlExpressionBinding(sharedControls[22])
.EndFrame()
.EndEntry()
.EndControl());
Expand All @@ -1096,7 +1083,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Par
yield return new FormatViewDefinition("MamlCommandParameterView",
CustomControl.Create()
.StartEntry()
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[22])
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[21])
.EndEntry()
.EndControl());
}
Expand All @@ -1106,7 +1093,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Syn
yield return new FormatViewDefinition("MamlCommandSyntax",
CustomControl.Create()
.StartEntry()
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[17])
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[16])
.EndEntry()
.EndControl());
}
Expand All @@ -1126,7 +1113,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_inp
yield return new FormatViewDefinition("MamlInputTypes",
CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"InputType", enumerateCollection: true, customControl: sharedControls[18])
.AddPropertyExpressionBinding(@"InputType", enumerateCollection: true, customControl: sharedControls[17])
.EndEntry()
.EndControl());
}
Expand All @@ -1136,7 +1123,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_non
yield return new FormatViewDefinition("MamlNonTerminatingErrors",
CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"nonTerminatingError", enumerateCollection: true, customControl: sharedControls[21])
.AddPropertyExpressionBinding(@"nonTerminatingError", enumerateCollection: true, customControl: sharedControls[20])
.EndEntry()
.EndControl());
}
Expand All @@ -1146,7 +1133,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_ter
yield return new FormatViewDefinition("MamlTerminatingErrors",
CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[21])
.AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[20])
.EndEntry()
.EndControl());
}
Expand All @@ -1156,7 +1143,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_rel
yield return new FormatViewDefinition("MamlRelatedLinks",
CustomControl.Create()
.StartEntry()
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[20])
.AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[19])
.EndEntry()
.EndControl());
}
Expand All @@ -1166,7 +1153,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_ret
yield return new FormatViewDefinition("MamlReturnTypes",
CustomControl.Create()
.StartEntry()
.AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[18])
.AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[17])
.EndEntry()
.EndControl());
}
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/CmdletInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public override string Definition
_verb,
StringLiterals.CommandVerbNounSeparator,
_noun,
parameterSet.ToString((this.CommandType & CommandTypes.Workflow) == CommandTypes.Workflow)));
parameterSet.ToString()));
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ internal CommandProcessorBase LookupCommandProcessor(CommandInfo commandInfo,
break;
case CommandTypes.Filter:
case CommandTypes.Function:
case CommandTypes.Workflow:
case CommandTypes.Configuration:
FunctionInfo functionInfo = (FunctionInfo)commandInfo;
processor = CreateCommandProcessorForScript(functionInfo, Context, useLocalScope ?? true, sessionState);
Expand Down
Loading