Skip to content

Commit 5eda4f7

Browse files
committed
Merge branch 'main' of https://github.com/Gijsreyn/operation-methods into fix-capabilities-discover-winpsadapter
2 parents 10e82cc + 90b4e2a commit 5eda4f7

File tree

683 files changed

+78270
-2532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

683 files changed

+78270
-2532
lines changed

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ "main", "release/v3.0.0", "release/v3.1" ]
5+
branches: [ "main", "release/*" ]
66
pull_request:
7-
branches: [ "main", "release/v3.0.0", "release/v3.1" ]
7+
branches: [ "main", "release/*" ]
88
paths-ignore:
99
- "docs/**"
1010
- "*.md"

.pipelines/DSC-Official.yml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,14 @@ extends:
133133
variables:
134134
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
135135
ob_sdl_tsa_configFile: '$(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
136-
ob_sdl_sbom_enabled: true
137-
ob_signing_setup_enabled: true
138-
ob_sdl_codeql_compiled_enabled: true
136+
ob_symbolsPublishing_enabled: true
137+
ob_symbolsPublishing_symbolsFolder: '$(Build.SourcesDirectory)\DSC\bin'
138+
ob_symbolsPublishing_searchPattern: '**/*.pdb'
139+
ob_symbolsPublishing_indexSources: true
140+
ob_sdl_sbom_enabled: false
141+
ob_signing_setup_enabled: false
142+
ob_sdl_codeql_compiled_enabled: false
143+
ob_restore_phase: true
139144
pool:
140145
type: windows
141146
steps:
@@ -152,17 +157,39 @@ extends:
152157
Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_x64/*.msix" ./bin/msix -Verbose
153158
Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_arm64/*.msix" ./bin/msix -Verbose
154159
./build.ps1 -PackageType msixbundle
155-
Copy-Item ./bin/*.msixbundle "$(ob_outputDirectory)"
160+
Copy-Item "$(Build.SourcesDirectory)/DSC/bin/*.msixbundle" "$(ob_outputDirectory)"
156161
displayName: 'Create msixbundle'
157162
condition: succeeded()
163+
164+
- job: SignMsixBundle
165+
dependsOn: CreateMsixBundle
166+
variables:
167+
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
168+
ob_sdl_sbom_enabled: false
169+
ob_signing_setup_enabled: true
170+
ob_sdl_codeql_compiled_enabled: false
171+
pool:
172+
type: windows
173+
steps:
174+
- task: DownloadPipelineArtifact@2
175+
inputs:
176+
buildType: 'current'
177+
artifact: drop_BuildAndSign_CreateMsixBundle
178+
itemPattern: |
179+
**/*.msixbundle
180+
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
181+
displayName: Download MsixBundle
158182
- task: onebranch.pipeline.signing@1
159183
displayName: Sign MsixBundle
160184
condition: succeeded()
161185
inputs:
162186
command: 'sign'
163-
signing_profile: $(MSIXProfile)
187+
signing_profile: 'Dynamic-WINMSAPP1ST'
164188
files_to_sign: '*.msixbundle'
165-
search_root: '$(ob_outputDirectory)'
189+
search_root: '$(Build.ArtifactStagingDirectory)/downloads'
190+
- pwsh: |
191+
Copy-Item "$(Build.ArtifactStagingDirectory)/downloads/*.msixbundle" "$(ob_outputDirectory)"
192+
displayName: 'Copy MsixBundle to output directory'
166193
167194
- job: BuildLinuxMusl
168195
dependsOn: SetPackageVersion
@@ -171,6 +198,9 @@ extends:
171198
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
172199
AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ]
173200
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
201+
ob_linuxSymbolsPublishing_enabled: true
202+
ob_linuxSymbolsPublishing_symbolsFolder: '$(Build.SourcesDirectory)/DSC/bin'
203+
ob_linuxSymbolsPublishing_searchPattern: '**/*.dbg'
174204
displayName: Linux-x64-musl
175205
pool:
176206
type: linux
@@ -202,6 +232,9 @@ extends:
202232
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
203233
AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ]
204234
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
235+
ob_linuxSymbolsPublishing_enabled: true
236+
ob_linuxSymbolsPublishing_symbolsFolder: '$(Build.SourcesDirectory)/DSC/bin'
237+
ob_linuxSymbolsPublishing_searchPattern: '**/*.dbg'
205238
displayName: Linux-ARM64-musl
206239
pool:
207240
type: linux

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ changes since the last release, see the [diff on GitHub][unreleased].
121121
- Added support for extensions to DSC. You can now use the `dsc extension list` command to
122122
enumerate available extensions. DSC now supports a single extension capability, `discover`, which
123123
returns JSON objects indicating where to find DSC resource manifests that aren't in the `PATH` or
124-
`DSC_PATH`, as with resources installed as Appx packages.
124+
`DSC_RESOURCE_PATH`, as with resources installed as Appx packages.
125125

126126
Now when DSC performs discovery, it recursively discovers extensions and resources on the system.
127127

@@ -135,7 +135,7 @@ changes since the last release, see the [diff on GitHub][unreleased].
135135
- [#760][#760]
136136
- [#762][#762]
137137

138-
- Addes support for passing parameters to the `dsc config` commands from stdin. You can pass
138+
- Adds support for passing parameters to the `dsc config` commands from stdin. You can pass
139139
_either_ the configuration document or parameters file contents to the command from stdin, but
140140
not both. This enables securely passing sensitive parameters to DSC without writing them to a
141141
file or defining them as an environment variable.

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ Please read the rest of this document to ensure a smooth contribution process.
2626

2727
### Contributing to documentation related to DSC
2828

29-
Please see the [PowerShell-Docs-DSC](https://github.com/MicrosoftDocs/PowerShell-Docs-DSC/) repository for details.
29+
You can contribute to documentation either in the `docs` folder of this repository
30+
or in the [PowerShell-Docs-DSC](https://github.com/MicrosoftDocs/PowerShell-Docs-DSC/) repository.
31+
32+
> [!NOTE]
33+
> Documentation contributed to the `docs` folder in this repository is periodically synced to the [PowerShell-Docs-DSC](https://github.com/MicrosoftDocs/PowerShell-Docs-DSC/) repository.
3034
3135
### Contributing to documentation related to maintaining or contributing to the DSC project
3236

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# DSCv3
22

33
> [!NOTE]
4-
> This repo isn't accepting code contributions. It's public and open source to show progress and
5-
> enable feedback. Once we're at a feature complete state, we can start taking code contributions.
4+
> We welcome code contributions to this repository. For guidelines on how to contribute,
5+
> see our [CONTRIBUTING.md](CONTRIBUTING.md).
6+
> Your feedback and participation help us improve DSCv3 for everyone.
67
78
## What's DSCv3?
89

@@ -22,7 +23,7 @@ DSCv3 differs from PowerShell DSC in a few important ways:
2223

2324
- DSCv3 doesn't depend on PowerShell. You can use DSCv3 without PowerShell installed and manage
2425
resources written in bash, python, C#, Go, or any other language.
25-
- DSCv3 use of PowerShell based resources does not depend on PSDesiredStateConfiguration module
26+
- DSCv3 use of PowerShell based resources does not depend on [PSDesiredStateConfiguration][00] module
2627
- DSCv3 doesn't include a local configuration manager. DSCv3 is invoked as a command. It doesn't
2728
run as a service.
2829
- Non-PowerShell resources define their schemas with JSON files, not MOF files.

build.ps1

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,23 @@ $filesForWindowsPackage = @(
5353
'osinfo.dsc.resource.json',
5454
'powershell.dsc.resource.json',
5555
'psDscAdapter/',
56+
'psscript.ps1',
57+
'psscript.dsc.resource.json',
58+
'winpsscript.dsc.resource.json',
5659
'reboot_pending.dsc.resource.json',
5760
'reboot_pending.resource.ps1',
5861
'registry.dsc.resource.json',
5962
'registry.exe',
6063
'RunCommandOnSet.dsc.resource.json',
6164
'RunCommandOnSet.exe',
6265
'sshdconfig.exe',
63-
'sshdconfig.dsc.resource.json',
66+
'sshd-windows.dsc.resource.json',
67+
'sshd_config.dsc.resource.json',
6468
'windowspowershell.dsc.resource.json',
6569
'wmi.dsc.resource.json',
6670
'wmi.resource.ps1',
71+
'wmiAdapter.psd1',
72+
'wmiAdapter.psm1',
6773
'windows_baseline.dsc.yaml',
6874
'windows_inventory.dsc.yaml'
6975
)
@@ -84,10 +90,12 @@ $filesForLinuxPackage = @(
8490
'osinfo.dsc.resource.json',
8591
'powershell.dsc.resource.json',
8692
'psDscAdapter/',
93+
'psscript.ps1',
94+
'psscript.dsc.resource.json',
8795
'RunCommandOnSet.dsc.resource.json',
8896
'runcommandonset',
8997
'sshdconfig',
90-
'sshdconfig.dsc.resource.json'
98+
'sshd_config.dsc.resource.json'
9199
)
92100

93101
$filesForMacPackage = @(
@@ -106,10 +114,12 @@ $filesForMacPackage = @(
106114
'osinfo.dsc.resource.json',
107115
'powershell.dsc.resource.json',
108116
'psDscAdapter/',
117+
'psscript.ps1',
118+
'psscript.dsc.resource.json',
109119
'RunCommandOnSet.dsc.resource.json',
110120
'runcommandonset',
111121
'sshdconfig',
112-
'sshdconfig.dsc.resource.json'
122+
'sshd_config.dsc.resource.json'
113123
)
114124

115125
# the list of files other than the binaries which need to be executable
@@ -172,6 +182,27 @@ if ($null -ne $packageType) {
172182
$BuildToolsPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC"
173183

174184
& $rustup default stable
185+
186+
## Test if Node is installed
187+
## Skipping upgrade as users may have a specific version they want to use
188+
if (!(Get-Command 'node' -ErrorAction Ignore)) {
189+
Write-Verbose -Verbose "Node.js not found, installing..."
190+
if (!$IsWindows) {
191+
if (Get-Command 'brew' -ErrorAction Ignore) {
192+
brew install node@24
193+
} else {
194+
Write-Warning "Homebrew not found, please install Node.js manually"
195+
}
196+
}
197+
else {
198+
if (Get-Command 'winget' -ErrorAction Ignore) {
199+
Write-Verbose -Verbose "Using winget to install Node.js"
200+
winget install OpenJS.NodeJS --accept-source-agreements --accept-package-agreements --source winget --silent
201+
} else {
202+
Write-Warning "winget not found, please install Node.js manually"
203+
}
204+
}
205+
}
175206
}
176207

177208
if (!$SkipBuild -and !$SkipLinkCheck -and $IsWindows -and !(Get-Command 'link.exe' -ErrorAction Ignore)) {
@@ -276,6 +307,7 @@ if (!$SkipBuild) {
276307
"dscecho",
277308
"osinfo",
278309
"powershell-adapter",
310+
'resources/PSScript',
279311
"process",
280312
"runcommandonset",
281313
"sshdconfig",
@@ -398,7 +430,8 @@ if (!$SkipBuild) {
398430
Copy-Item "*.dsc.resource.json" $target -Force -ErrorAction Ignore
399431
}
400432
else { # don't copy WindowsPowerShell resource manifest
401-
Copy-Item "*.dsc.resource.json" $target -Exclude 'windowspowershell.dsc.resource.json' -Force -ErrorAction Ignore
433+
$exclude = @('windowspowershell.dsc.resource.json', 'winpsscript.dsc.resource.json')
434+
Copy-Item "*.dsc.resource.json" $target -Exclude $exclude -Force -ErrorAction Ignore
402435
}
403436

404437
# be sure that the files that should be executable are executable

docs/reference/cli/config/export.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ dsc config export [Options] --input <INPUT>
3131
cat <FILE> | dsc config export [Options] --file -
3232
```
3333

34+
### Configuration document from file with parameters from stdin
35+
36+
```sh
37+
cat <PARAMETERS_FILE> | dsc config --parameters-file - export [Options] --file <FILE>
38+
```
39+
40+
### Configuration document from option string with parameters from stdin
41+
42+
```sh
43+
cat <PARAMETERS_FILE> | dsc config --parameters-file - export [Options] --input <INPUT>
44+
```
45+
3446
## Description
3547

3648
The `export` subcommand generates a configuration document that includes every instance of a set of

docs/reference/cli/config/get.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ dsc config get [Options] --input <INPUT>
3131
cat <FILE> | dsc config get [Options] --file -
3232
```
3333

34+
### Configuration document from file with parameters from stdin
35+
36+
```sh
37+
cat <PARAMETERS_FILE> | dsc config --parameters-file - get [Options] --file <FILE>
38+
```
39+
40+
### Configuration document from option string with parameters from stdin
41+
42+
```sh
43+
cat <PARAMETERS_FILE> | dsc config --parameters-file - get [Options] --input <INPUT>
44+
```
45+
3446
## Description
3547

3648
The `get` subcommand returns the actual state of the resource instances in a configuration

docs/reference/cli/config/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ for that parameter.
7878

7979
This option is mutually exclusive with the `--parameters` option.
8080

81+
Starting with DSC version 3.1.0, you can pass the parameters data to a subcommand over stdin. When
82+
you do, you must pass the configuration document as an input string or the path to a file on the
83+
system. You can't pass both the parameters file and the configuration document to a command from
84+
stdin.
85+
8186
For more information about defining parameters in a configuration document, see
8287
[DSC Configuration document parameter schema][06]. For more information about using parameters in
8388
configuration document, see the [parameters function reference][07].

docs/reference/cli/config/set.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ dsc config set [Options] --input <INPUT>
3131
cat <FILE> | dsc config set [Options] --file -
3232
```
3333

34+
### Configuration document from file with parameters from stdin
35+
36+
```sh
37+
cat <PARAMETERS_FILE> | dsc config --parameters-file - set [Options] --file <FILE>
38+
```
39+
40+
### Configuration document from option string with parameters from stdin
41+
42+
```sh
43+
cat <PARAMETERS_FILE> | dsc config --parameters-file - set [Options] --input <INPUT>
44+
```
45+
46+
3447
## Description
3548

3649
The `set` subcommand enforces the desired state of the resource instances in a configuration

0 commit comments

Comments
 (0)