Skip to content

Commit fb8ba6c

Browse files
committed
Implement PowerShell import extension
1 parent 18fd542 commit fb8ba6c

File tree

6 files changed

+491
-0
lines changed

6 files changed

+491
-0
lines changed

build.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ $filesForWindowsPackage = @(
4848
'appx.dsc.extension.json',
4949
'appx-discover.ps1',
5050
'bicep.dsc.extension.json',
51+
'convert-resource.ps1',
52+
'convertDscResource.psd1',
53+
'convertDscResource.psm1',
5154
'dsc.exe',
5255
'dsc_default.settings.json',
5356
'dsc.settings.json',
@@ -60,6 +63,7 @@ $filesForWindowsPackage = @(
6063
'osinfo.exe',
6164
'osinfo.dsc.resource.json',
6265
'powershell.dsc.resource.json',
66+
'powershell.dsc.extension.json'
6367
'psDscAdapter/',
6468
'psscript.ps1',
6569
'psscript.dsc.resource.json',
@@ -316,6 +320,7 @@ if (!$SkipBuild) {
316320
"dsc",
317321
"dscecho",
318322
"extensions/bicep",
323+
"extensions/powershell"
319324
"osinfo",
320325
"powershell-adapter",
321326
'resources/PSScript',
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[CmdletBinding()]
2+
param (
3+
[Parameter(ValueFromPipeline = $true)]
4+
[string]$stringInput
5+
)
6+
7+
return "{}"
8+
9+
# begin {
10+
# $lines = [System.Collections.Generic.List[string]]::new()
11+
12+
# $scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru
13+
# }
14+
15+
# process {
16+
# # Process each line of input
17+
# foreach ($line in $stringInput) {
18+
# $lines.Add($line)
19+
# }
20+
# }
21+
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+
# }
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
@{
5+
6+
# Script module or binary module file associated with this manifest.
7+
RootModule = 'convertDscResource.psm1'
8+
9+
# Version number of this module.
10+
moduleVersion = '0.0.1'
11+
12+
# ID used to uniquely identify this module
13+
GUID = '95f93fd3-34ff-417e-80e4-f0112918a0bd'
14+
15+
# Author of this module
16+
Author = 'Microsoft Corporation'
17+
18+
# Company or vendor of this module
19+
CompanyName = 'Microsoft Corporation'
20+
21+
# Copyright statement for this module
22+
Copyright = '(c) Microsoft Corporation. All rights reserved.'
23+
24+
# Description of the functionality provided by this module
25+
Description = 'PowerShell Desired State Configuration Module for converting DSC Resources to JSON format'
26+
27+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
28+
FunctionsToExport = @(
29+
'Write-DscTrace'
30+
'Build-DscConfigDocument'
31+
)
32+
33+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
34+
CmdletsToExport = @()
35+
36+
# Variables to export from this module
37+
VariablesToExport = @()
38+
39+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
40+
AliasesToExport = @()
41+
42+
PrivateData = @{
43+
PSData = @{
44+
ProjectUri = 'https://github.com/PowerShell/dsc'
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)