File tree Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Original file line number Diff line number Diff line change 1
1
[CmdletBinding ()]
2
2
param (
3
3
[Parameter (ValueFromPipeline = $true )]
4
- [string ]$stringInput
4
+ [string [] ]$stringInput
5
5
)
6
6
7
- return " {}"
7
+ begin {
8
+ $lines = [System.Collections.Generic.List [string ]]::new()
8
9
9
- # begin {
10
- # $lines = [System.Collections.Generic.List[string]]::new()
10
+ $scriptModule = Import-Module " $PSScriptRoot /convertDscResource.psd1 " - Force - PassThru
11
+ }
11
12
12
- # $scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru
13
- # }
13
+ process {
14
+ foreach ($line in $stringInput ) {
15
+ $lines.Add ($line )
16
+ }
17
+ }
14
18
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 ) )
21
22
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
+ }
You can’t perform that action at this time.
0 commit comments