GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [feature] · PowerShell/PowerShell@49f7c17

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/System.Management.Automation/FormatAndOutput/common
    • BaseOutputtingCommand.cs
  • test/powershell
    • Language/Classes
      • Scripting.Classes.Attributes.Tests.ps1
      • Scripting.Classes.BasicParsing.Tests.ps1
    • Modules/Microsoft.PowerShell.Utility
      • Format-Custom.Tests.ps1
      • Format-List.Tests.ps1
      • Format-Table.Tests.ps1
      • Out-File.Tests.ps1
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs‎

Copy file name to clipboardExpand all lines: src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ private void ProcessGroupStart(FormatMessagesContextManager.OutputContext c)
476476
ComplexWriter writer = new ComplexWriter();
477477
writer.Initialize(_lo, _lo.ColumnNumber);
478478
writer.WriteObject(goc.Data.groupingEntry.formatValueList);
479-
480-
this.LineOutput.WriteLine(string.Empty);
481479
}
482480
goc.GroupStart();
483481
}
@@ -493,7 +491,6 @@ private void ProcessGroupEnd(GroupEndData ge, FormatMessagesContextManager.Outpu
493491
GroupOutputContext goc = (GroupOutputContext)c;
494492

495493
goc.GroupEnd();
496-
this.LineOutput.WriteLine(string.Empty);
497494
}
498495

499496
/// <summary>
@@ -761,7 +758,7 @@ private void ProcessCachedGroupOnWide(WideViewHeaderInfo wvhi, List<PacketInfoDa
761758
/// </summary>
762759
static private int GetConsoleWindowWidth(int columnNumber)
763760
{
764-
if (InternalTestHooks.SetConsoleWidthToZero)
761+
if (InternalTestHooks.SetConsoleWidthToZero)
765762
{
766763
return DefaultConsoleWidth;
767764
}
@@ -1106,7 +1103,6 @@ internal static string[] GetValues(ListViewEntry lve)
11061103
/// </summary>
11071104
internal override void GroupStart()
11081105
{
1109-
this.InnerCommand._lo.WriteLine(string.Empty);
11101106
}
11111107

11121108
/// <summary>
@@ -1194,7 +1190,6 @@ internal override void Initialize()
11941190
/// </summary>
11951191
internal override void GroupStart()
11961192
{
1197-
this.InnerCommand._lo.WriteLine(string.Empty);
11981193
}
11991194

12001195
/// <summary>
Collapse file

‎test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Describe 'ValidateSet support a dynamically generated set' -Tag "CI" {
401401
Import-Module -Name $moduleFile -Force
402402
Test-ValidateSet 'Hello' | Should -BeExactly 'Hello'
403403
} finally {
404-
Remove-Module -Name $moduleFile -Force
404+
Remove-Module -Name $moduleFile -Force -ErrorAction SilentlyContinue
405405
}
406406
}
407407
}
Collapse file

‎test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ visibleX visibleY
589589
10 12
590590
591591
592-
593592
"@
594593

595594
$tableOutput = $instance | Format-Table -AutoSize | Out-String
Collapse file

‎test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,14 @@ Describe "Format-Custom with expression based EntrySelectedBy in a CustomControl
399399
400400
401401
Entry selected by property
402-
403402
Name
404403
----
405404
testing
406405
407406
407+
'@ -replace '\r?\n', "^"
408408

409-
'@ -replace '\r?\n', [Environment]::NewLine
410-
411-
$ps.Invoke() | Should -BeExactly $expectedOutput
409+
$ps.Invoke() -replace '\r?\n', "^" | Should -BeExactly $expectedOutput
412410
$ps.Streams.Error | Should -BeNullOrEmpty
413411
}
414412

@@ -427,16 +425,14 @@ testing
427425
428426
429427
Entry selected by ScriptBlock
430-
431428
Name
432429
----
433430
SelectScriptBlock
434431
435432
433+
'@ -replace '\r?\n', "^"
436434

437-
'@ -replace '\r?\n', [Environment]::NewLine
438-
439-
$ps.Invoke() | Should -BeExactly $expectedOutput
435+
$ps.Invoke() -replace '\r?\n', "^" | Should -BeExactly $expectedOutput
440436
$ps.Streams.Error | Should -BeNullOrEmpty
441437
}
442438
}
Collapse file

‎test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Describe "Format-List" -Tags "CI" {
2323
}
2424

2525
It "Should produce the expected output" {
26-
$expected = "${nl}${nl}testName : testValue${nl}${nl}${nl}${nl}"
26+
$expected = "${nl}testName : testValue${nl}${nl}${nl}"
2727
$in = New-Object PSObject
2828
Add-Member -InputObject $in -MemberType NoteProperty -Name testName -Value testValue
2929

Collapse file

‎test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ gHeader
338338
1 2 3
339339
340340
341-
342341
"@ },
343342
@{ view = "Default"; widths = 4,7,4; variation = "4 row, 1 row, 2 row"; expectedTable = @"
344343
@@ -350,7 +349,6 @@ er
350349
1 2 3
351350
352351
353-
354352
"@ },
355353
@{ view = "Default"; widths = 4,4,7; variation = "4 row, 2 row, 1 row"; expectedTable = @"
356354
@@ -362,7 +360,6 @@ er
362360
1 2 3
363361
364362
365-
366363
"@ },
367364
@{ view = "Default"; widths = 14,7,3; variation = "1 row, 1 row, 3 row"; expectedTable = @"
368365
@@ -373,7 +370,6 @@ LongLongHeader Header2 Hea
373370
1 2 3
374371
375372
376-
377373
"@ },
378374
@{ view = "One"; widths = 4,1,1; variation = "1 column"; expectedTable = @"
379375
@@ -385,7 +381,6 @@ er
385381
1
386382
387383
388-
389384
"@ }
390385
) {
391386
param($view, $widths, $expectedTable)
@@ -487,7 +482,6 @@ er
487482
1**********2***3
488483
489484
490-
491485
"@ },
492486
@{ view = "Default"; widths = 4,7,5; variation = "narrow values with wrap"; values = [PSCustomObject]@{First=1;Second=2;Third=3}; wrap = $true; expectedTable = @"
493487
@@ -499,7 +493,6 @@ er
499493
1**********2*3
500494
501495
502-
503496
"@ },
504497
@{ view = "Default"; widths = 4,7,5; variation = "wide values"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $false; expectedTable = @"
505498
@@ -511,7 +504,6 @@ er
511504
1...*...5678*12...
512505
513506
514-
515507
"@ },
516508
@{ view = "One"; widths = 3,1,1; variation = "wide values, 1 column"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $false; expectedTable = @"
517509
@@ -524,7 +516,6 @@ er
524516
123
525517
526518
527-
528519
"@ },
529520
@{ view = "Default"; widths = 4,8,6; variation = "wide values with wrap, 1st column"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $true; expectedTable = @"
530521
@@ -537,7 +528,6 @@ er
537528
5
538529
539530
540-
541531
"@ },
542532
@{ view = "Default"; widths = 5,7,6; variation = "wide values with wrap, 2nd column"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $true; expectedTable = @"
543533
@@ -549,7 +539,6 @@ ader
549539
************8
550540
551541
552-
553542
"@ },
554543
@{ view = "Default"; widths = 5,8,5; variation = "wide values with wrap, 3rd column"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $true; expectedTable = @"
555544
@@ -561,7 +550,6 @@ ader
561550
***************6
562551
563552
564-
565553
"@ },
566554
@{ view = "Default"; widths = 4,7,5; variation = "wide values with wrap, all 3 columns"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $true; expectedTable = @"
567555
@@ -574,7 +562,6 @@ er
574562
5**********8*6
575563
576564
577-
578565
"@ },
579566
@{ view = "One"; widths = 3,1,1; variation = "wide values with wrap, with 1 column"; values = [PSCustomObject]@{First="12345";Second="12345678";Third="123456"}; wrap = $true; expectedTable = @"
580567
@@ -588,7 +575,6 @@ er
588575
45
589576
590577
591-
592578
"@ }
593579
) {
594580
param($view, $widths, $values, $wrap, $expectedTable)
@@ -690,7 +676,6 @@ abc bcd
690676
1 1234
691677
692678
693-
694679
"@ },
695680
@{ variation = "both columns"; obj = [pscustomobject]@{abc="1234";bcd="1234"},[pscustomobject]@{abc="1";bcd="1"}; expectedTable = @"
696681
@@ -700,7 +685,6 @@ abc bcd
700685
1 1
701686
702687
703-
704688
"@ },
705689
@{ variation = "second column"; obj = [pscustomobject]@{abc="123";bcd="1234"},[pscustomobject]@{abc="1";bcd="123"}; expectedTable = @"
706690
@@ -710,7 +694,6 @@ abc bcd
710694
1 123
711695
712696
713-
714697
"@ }
715698
) {
716699
param($obj, $expectedTable)
@@ -726,7 +709,6 @@ a b
726709
abc 123
727710
728711
729-
730712
"@ },
731713
@{ variation = "left/left"; obj = [PSCustomObject]@{a="abc";b="abc"}; expectedTable = @"
732714
@@ -735,7 +717,6 @@ a b
735717
abc abc
736718
737719
738-
739720
"@ },
740721
@{ variation = "right/left"; obj = [PSCustomObject]@{a=123;b="abc"}; expectedTable = @"
741722
@@ -744,7 +725,6 @@ abc abc
744725
123 abc
745726
746727
747-
748728
"@ },
749729
@{ variation = "right/right"; obj = [PSCustomObject]@{a=123;b=123}; expectedTable = @"
750730
@@ -753,7 +733,6 @@ abc abc
753733
123 123
754734
755735
756-
757736
"@ }
758737
) {
759738
param($obj, $expectedTable)
@@ -771,7 +750,6 @@ A B Name
771750
multiline content
772751
773752
774-
775753
"@ },
776754
@{ variation = "left"; obj = [pscustomobject] @{Name="This`nIs some random`nmultiline content";A=1;B=2}; expectedTable = @"
777755
@@ -782,7 +760,6 @@ Is some random
782760
multiline content
783761
784762
785-
786763
"@ },
787764
@{ variation = "middle"; obj = [pscustomobject] @{A=1;Name="This`nIs some random`nmultiline content";B=2}; expectedTable = @"
788765
@@ -793,7 +770,6 @@ A Name B
793770
multiline content
794771
795772
796-
797773
"@ }
798774
) {
799775
param($obj, $expectedTable)
Collapse file

‎test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1‎

Copy file name to clipboardExpand all lines: test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1
+8-10Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ Describe "Out-File" -Tags "CI" {
8383
$actual[3] | Should -Match "some test text"
8484
$actual[4] | Should -BeNullOrEmpty
8585
$actual[5] | Should -BeNullOrEmpty
86-
$actual[6] | Should -BeNullOrEmpty
87-
$actual[7] | Should -Match "text"
88-
$actual[8] | Should -Match "----"
89-
$actual[9] | Should -Match "some test text"
86+
$actual[6] | Should -Match "text"
87+
$actual[7] | Should -Match "----"
88+
$actual[8] | Should -Match "some test text"
89+
$actual[9] | Should -BeNullOrEmpty
9090
$actual[10] | Should -BeNullOrEmpty
91-
$actual[11] | Should -BeNullOrEmpty
9291
}
9392

9493
It "Should limit each line to the specified number of characters when the width switch is used on objects" {
@@ -119,12 +118,11 @@ Describe "Out-File" -Tags "CI" {
119118
$actual[3] | Should -Match "some test text"
120119
$actual[4] | Should -BeNullOrEmpty
121120
$actual[5] | Should -BeNullOrEmpty
122-
$actual[6] | Should -BeNullOrEmpty
123-
$actual[7] | Should -Match "text"
124-
$actual[8] | Should -Match "----"
125-
$actual[9] | Should -Match "some test text"
121+
$actual[6] | Should -Match "text"
122+
$actual[7] | Should -Match "----"
123+
$actual[8] | Should -Match "some test text"
124+
$actual[9] | Should -BeNullOrEmpty
126125
$actual[10] | Should -BeNullOrEmpty
127-
$actual[11] | Should -BeNullOrEmpty
128126

129127
# reset to not read only so it can be deleted
130128
Set-ItemProperty -Path $testfile -Name IsReadOnly -Value $false

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.