@@ -56,54 +56,54 @@ Describe 'ConvertTo-Table' -Tag Unit {
5656 # linux and macOS don't have Fake
5757 function Get-FakeService {
5858 [PSCustomObject ]@ {
59- Name = " AppMgmt"
59+ Name = " AppMgmt"
6060 DisplayName = " Application Management"
61- Status = " Running"
61+ Status = " Running"
6262 }
6363 [PSCustomObject ]@ {
64- Name = " BITS"
64+ Name = " BITS"
6565 DisplayName = " Background Intelligent Transfer Service"
66- Status = " Running"
66+ Status = " Running"
6767 }
6868 [PSCustomObject ]@ {
69- Name = " Dhcp"
69+ Name = " Dhcp"
7070 DisplayName = " DHCP Client"
71- Status = " Running"
71+ Status = " Running"
7272 }
7373 [PSCustomObject ]@ {
74- Name = " DsmSvc"
74+ Name = " DsmSvc"
7575 DisplayName = " Device Setup Manager"
76- Status = " Running"
76+ Status = " Running"
7777 }
7878 [PSCustomObject ]@ {
79- Name = " EFS"
79+ Name = " EFS"
8080 DisplayName = " Encrypting File System (EFS)"
81- Status = " Running"
81+ Status = " Running"
8282 }
8383 [PSCustomObject ]@ {
84- Name = " lmhosts"
84+ Name = " lmhosts"
8585 DisplayName = " TCP/IP NetBIOS Helper"
86- Status = " Running"
86+ Status = " Running"
8787 }
8888 [PSCustomObject ]@ {
89- Name = " MSDTC"
89+ Name = " MSDTC"
9090 DisplayName = " Distributed Transaction Coordinator"
91- Status = " Stopped"
91+ Status = " Stopped"
9292 }
9393 [PSCustomObject ]@ {
94- Name = " NlaSvc"
94+ Name = " NlaSvc"
9595 DisplayName = " Network Location Awareness"
96- Status = " Stopped"
96+ Status = " Stopped"
9797 }
9898 [PSCustomObject ]@ {
99- Name = " PolicyAgent"
99+ Name = " PolicyAgent"
100100 DisplayName = " IPsec Policy Agent"
101- Status = " Stopped"
101+ Status = " Stopped"
102102 }
103103 [PSCustomObject ]@ {
104- Name = " SessionEnv"
104+ Name = " SessionEnv"
105105 DisplayName = " Remote Desktop Configuration"
106- Status = " Stopped"
106+ Status = " Stopped"
107107 }
108108 }
109109 # endregion Mocking
@@ -204,5 +204,19 @@ Describe 'ConvertTo-Table' -Tag Unit {
204204 @ ($table ).Count | Should - Be 1
205205 @ ($row ).Count | Should - BeGreaterThan 1
206206 }
207+
208+ It " returns a single table when using the pipeline" {
209+ $table = Get-FakeService | ConvertTo-ConfluenceTable
210+ $row = $table -split [Environment ]::NewLine
211+
212+ $row | Should - HaveCount 12
213+ $row [0 ] | Should - BeExactly ' || Name || DisplayName || Status ||'
214+ $row [1 .. 10 ] | ForEach-Object {
215+ $_ | Should -Match ' ^| [\w\s]+? | [\w\s]+? | [\w\s]+? |$'
216+ $_ | Should -Not -Match ' \|\|'
217+ $_ | Should -Not -Match ' \|\s\s+\|'
218+ }
219+ $row [11 ] | Should - BeNullOrEmpty
220+ }
207221 }
208222}
0 commit comments