Skip to content

Commit e3e43b3

Browse files
committed
Uncomment section
1 parent fb8ba6c commit e3e43b3

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
[CmdletBinding()]
22
param (
33
[Parameter(ValueFromPipeline = $true)]
4-
[string]$stringInput
4+
[string[]]$stringInput
55
)
66

7-
return "{}"
7+
begin {
8+
$lines = [System.Collections.Generic.List[string]]::new()
89

9-
# begin {
10-
# $lines = [System.Collections.Generic.List[string]]::new()
10+
$scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru
11+
}
1112

12-
# $scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru
13-
# }
13+
process {
14+
foreach ($line in $stringInput) {
15+
$lines.Add($line)
16+
}
17+
}
1418

15-
# process {
16-
# # Process each line of input
17-
# foreach ($line in $stringInput) {
18-
# $lines.Add($line)
19-
# }
20-
# }
19+
end {
20+
if ($lines.Count -ne 0) {
21+
$result = $scriptModule.invoke( { param($lines) Build-DscConfigDocument -Content $lines }, ($lines | Out-String) )
2122

22-
# end {
23-
# if ($lines.Count -ne 0) {
24-
# $result = $scriptModule.invoke( { param($lines) Build-DscConfigDocument -Content $lines }, ($lines | Out-String) )
25-
26-
# return ($result | ConvertTo-Json -Depth 10)
27-
# }
28-
# }
23+
return ($result | ConvertTo-Json -Depth 10 -Compress)
24+
}
25+
}

0 commit comments

Comments
 (0)