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 @@ -11,10 +11,9 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
{
var SignatureTypes_GroupingFormat = CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
.StartFrame()
.AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
.AddScriptBlockExpressionBinding(@"split-path $_.Path")
.AddNewline()
.EndFrame()
.EndEntry()
.EndControl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
{
var FileSystemTypes_GroupingFormat = CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
.StartFrame()
.AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
.AddScriptBlockExpressionBinding(@"
$_.PSParentPath.Replace(""Microsoft.PowerShell.Core\FileSystem::"", """")
")
.AddNewline()
.EndFrame()
.EndEntry()
.EndControl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
{
var AvailableModules_GroupingFormat = CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
.StartFrame()
.AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
.AddScriptBlockExpressionBinding(@"Split-Path -Parent $_.Path | ForEach-Object { if([Version]::TryParse((Split-Path $_ -Leaf), [ref]$null)) { Split-Path -Parent $_} else {$_} } | Split-Path -Parent")
.AddNewline()
.EndFrame()
.EndEntry()
.EndControl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
{
var Registry_GroupingFormat = CustomControl.Create()
.StartEntry()
.StartFrame(leftIndent: 4)
.AddText("Hive: ")
.StartFrame()
.AddText(" Hive: ")
.AddScriptBlockExpressionBinding(@"$_.PSParentPath.Replace(""Microsoft.PowerShell.Core\Registry::"", """")")
.AddNewline()
.EndFrame()
.EndEntry()
.EndControl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ private void ProcessGroupStart(FormatMessagesContextManager.OutputContext c)
ComplexWriter writer = new ComplexWriter();
writer.Initialize(_lo, _lo.ColumnNumber);
writer.WriteObject(goc.Data.groupingEntry.formatValueList);
_lo.WriteLine(string.Empty);
}

goc.GroupStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<value>Cannot process the file because the file {0} was not found.</value>
</data>
<data name="DirectoryDisplayGrouping" xml:space="preserve">
<value>Directory: </value>
<value> Directory: </value>
</data>
<data name="ReadBackward_Encoding_NotSupport" xml:space="preserve">
<value>Cannot detect the encoding of the file. The specified encoding {0} is not supported when the content is read in reverse.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ Describe "Format-Custom with expression based EntrySelectedBy in a CustomControl


Entry selected by property

Name
----
testing
Expand All @@ -425,6 +426,7 @@ testing


Entry selected by ScriptBlock

Name
----
SelectScriptBlock
Expand Down