Skip to content

Commit 0a934c5

Browse files
authored
Merge pull request #397 from michaeltlombardi/schemas/main/update-schemas-preview.7
(SCHEMAS) Update schemas for preview.7
2 parents d75cc5c + 87ca2a9 commit 0a934c5

File tree

170 files changed

+13216
-323
lines changed

Some content is hidden

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

170 files changed

+13216
-323
lines changed

.vscode/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"json.schemas": [
1414
{
1515
"fileMatch": ["**/*.dsc.resource.json"],
16-
"url": "/schemas/2023/10/bundled/resource/manifest.vscode.json"
16+
"url": "/schemas/2024/04/bundled/resource/manifest.vscode.json"
1717
}
1818
],
1919
"yaml.schemas": {
20-
"schemas/2023/10/bundled/config/document.vscode.json": "**.dsc.{yaml,yml,config.yaml,config.yml}",
21-
"schemas/2023/10/bundled/resource/manifest.vscode.json": "**.dsc.resource.{yaml,yml}"
20+
"schemas/2024/04/bundled/config/document.vscode.json": "**.dsc.{yaml,yml,config.yaml,config.yml}",
21+
"schemas/2024/04/bundled/resource/manifest.vscode.json": "**.dsc.resource.{yaml,yml}"
2222
},
2323
"sarif-viewer.connectToGithubCodeScanning": "off"
2424
}

dsc/assertion.dsc.resource.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
2+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
33
"type": "Microsoft.DSC/Assertion",
44
"version": "0.1.0",
55
"description": "`test` will be invoked for all resources in the supplied configuration.",

dsc/examples/assertion.dsc.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Example configuration that uses assertions to validate the environment before running the configuration.
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: current user registry
55
type: Microsoft.Windows/Registry
66
properties:
77
keyPath: HKCU\example
8-
_ensure: Present
8+
_exist: true
99
dependsOn:
1010
- "[resourceId('Microsoft.DSC/Assertion','my assertions')]"
1111
- name: my assertions
1212
type: Microsoft.DSC/Assertion
1313
properties:
14-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
14+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
1515
resources:
1616
- name: os
1717
type: Microsoft/OSInfo

dsc/examples/brew.dsc.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Example to see if PowerShell 7 is installed, install it, or get all installed packages
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: assertions
55
type: Microsoft.DSC/Assertion
66
properties:
7-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
7+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
88
resources:
99
- name: os_check
1010
type: Microsoft/OSInfo

dsc/examples/brew_export.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Example to see if PowerShell 7 is installed, install it, or get all installed packages
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: brew
55
type: DSC.PackageManagement/Brew

dsc/examples/brew_uninstall.dsc.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Example to see if PowerShell 7 is installed, install it, or get all installed packages
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: assertions
55
type: Microsoft.DSC/Assertion
66
properties:
7-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
7+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
88
resources:
99
- name: os_check
1010
type: Microsoft/OSInfo

dsc/examples/groups.dsc.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Example for grouping and groups in groups
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
metadata:
44
Microsoft.DSC:
55
requiredSecurityContext: Current # this is the default and just used as an example indicating this config works for admins and non-admins
66
resources:
77
- name: Last Group
88
type: Microsoft.DSC/Group
99
properties:
10-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
10+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
1111
resources:
1212
- name: Last
1313
type: Test/Echo
@@ -18,7 +18,7 @@ resources:
1818
- name: First Group
1919
type: Microsoft.DSC/Group
2020
properties:
21-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
21+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2222
resources:
2323
- name: First
2424
type: Test/Echo
@@ -27,7 +27,7 @@ resources:
2727
- name: Nested Group
2828
type: Microsoft.DSC/Group
2929
properties:
30-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
30+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
3131
resources:
3232
- name: Nested Second
3333
type: Test/Echo

dsc/examples/invalid_schema.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Sample configuration with invalid properties that don't match the resource schema.
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: os
55
type: Microsoft/OSInfo

dsc/examples/osinfo.dsc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json",
2+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json",
33
"resources": [
44
{
55
"name": "os",

dsc/examples/osinfo_parameters.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
1+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
22
parameters:
33
osFamily:
44
type: string

dsc/examples/osinfo_registry.dsc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json",
2+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json",
33
"metadata": {
44
"description": "Simple example using two different resources and one of them twice."
55
},

dsc/examples/osinfo_registry.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simple example using two different resources and one of them twice.
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: os
55
type: Microsoft/OSInfo

dsc/examples/parallel.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Example on how concurrency would be defined in the configuration.
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
metadata:
44
_timeoutSeconds: 600 # example of setting timeout for orchestration, should be namespaced?
55
resources:

dsc/examples/powershell.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Example configuration mixing native app resources with classic PS resources
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: Use class PowerShell resources
55
type: Microsoft.DSC/PowerShell

dsc/examples/reference.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simple example showing how to reference output from a resource to use in another
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33
resources:
44
- name: os
55
type: Microsoft/OSInfo

dsc/examples/require_admin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# example showing use of specific metadata to indicate this config requires admin to run
22
# note that the resource doesn't require admin, but this will fail to even try to run the
33
# config if the user is not root or elevated as administrator
4-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
4+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
55
metadata:
66
Microsoft.DSC:
77
securityContext: Elevated

dsc/examples/require_nonadmin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# example showing use of specific metadata to indicate this config requires admin to run
22
# this will fail to even try to run the config if the user is root or elevated as administrator
3-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
3+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
44
metadata:
55
Microsoft.DSC:
66
securityContext: Restricted

dsc/examples/secure_parameters.dsc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
1+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
22
parameters:
33
myString:
44
type: secureString

dsc/group.dsc.resource.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
2+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
33
"type": "Microsoft.DSC/Group",
44
"version": "0.1.0",
55
"description": "All resources in the supplied configuration is treated as a group.",

dsc/parallel.dsc.resource.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
2+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
33
"type": "Microsoft.DSC/Parallel",
44
"version": "0.1.0",
55
"description": "All resources in the supplied configuration run concurrently.",

dsc/tests/dsc_args.tests.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Describe 'config argument tests' {
55
BeforeAll {
66
$manifest = @'
77
{
8-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
8+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
99
"type": "Test/Hello",
1010
"version": "0.1.0",
1111
"get": {
@@ -107,7 +107,7 @@ actualState:
107107
param($parameter)
108108

109109
$yaml = @'
110-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
110+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
111111
resources:
112112
- name: os
113113
type: Microsoft/OSInfo
@@ -127,7 +127,7 @@ resources:
127127
param($parameter)
128128

129129
$yaml = @'
130-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
130+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
131131
resources:
132132
- name: os
133133
type: Microsoft/OSInfo

dsc/tests/dsc_config_get.tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Describe 'dsc config get tests' {
3434

3535
It 'can accept the use of --format as a subcommand' {
3636
$config_yaml = @"
37-
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
37+
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
3838
resources:
3939
- name: Echo
4040
type: Test/Echo

dsc/tests/dsc_config_set.tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Describe 'dsc config set tests' {
55
It 'can use _exist with resources that support and do not support it' {
66
$config_yaml = @"
7-
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
7+
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
88
resources:
99
- name: Exist
1010
type: Test/Exist

dsc/tests/dsc_discovery.tests.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Describe 'tests for resource discovery' {
1717
It 'Use DSC_RESOURCE_PATH instead of PATH when defined' {
1818
$resourceJson = @'
1919
{
20-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
20+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
2121
"type": "DSC/TestPathResource",
2222
"version": "0.1.0",
2323
"get": {
@@ -39,7 +39,7 @@ Describe 'tests for resource discovery' {
3939
param($extension)
4040

4141
$resourceYaml = @'
42-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json
42+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json
4343
type: DSC/TestYamlResource
4444
version: 0.1.0
4545
get:
@@ -56,7 +56,7 @@ Describe 'tests for resource discovery' {
5656
param($extension)
5757

5858
$resourceInput = @'
59-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json
59+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json
6060
type: DSC/TestYamlResource
6161
version: 0.1.0
6262
get:
@@ -71,7 +71,7 @@ Describe 'tests for resource discovery' {
7171
It 'warns on invalid semver' {
7272
$manifest = @'
7373
{
74-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
74+
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json",
7575
"type": "Test/InvalidSemver",
7676
"version": "1.1.0..1",
7777
"get": {

dsc/tests/dsc_export.tests.ps1

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Describe 'resource export tests' {
88
$out = dsc resource export -r Microsoft/Process
99
$LASTEXITCODE | Should -Be 0
1010
$config_with_process_list = $out | ConvertFrom-Json
11-
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json'
11+
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json'
1212
$config_with_process_list.'resources' | Should -Not -BeNullOrEmpty
1313
$config_with_process_list.resources.count | Should -BeGreaterThan 1
1414
}
@@ -25,7 +25,7 @@ Describe 'resource export tests' {
2525
It 'Export can be called on a configuration' {
2626

2727
$yaml = @'
28-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
28+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2929
resources:
3030
- name: Processes
3131
type: Microsoft/Process
@@ -35,7 +35,7 @@ Describe 'resource export tests' {
3535
$out = $yaml | dsc config export
3636
$LASTEXITCODE | Should -Be 0
3737
$config_with_process_list = $out | ConvertFrom-Json
38-
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json'
38+
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json'
3939
$config_with_process_list.'resources' | Should -Not -BeNullOrEmpty
4040
$config_with_process_list.resources.count | Should -BeGreaterThan 1
4141
$config_with_process_list.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'Export'
@@ -44,7 +44,7 @@ Describe 'resource export tests' {
4444
It 'Configuration Export can be piped to configuration Set' -Skip:(!$IsWindows) {
4545

4646
$yaml = @'
47-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
47+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
4848
resources:
4949
- name: Processes
5050
type: Microsoft/Process
@@ -60,7 +60,7 @@ Describe 'resource export tests' {
6060
It 'Duplicate resource types in Configuration Export should not result in error' {
6161

6262
$yaml = @'
63-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
63+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
6464
resources:
6565
- name: Processes
6666
type: Microsoft/Process
@@ -80,15 +80,15 @@ Describe 'resource export tests' {
8080
$out = dsc resource export -r Microsoft/Process -f pretty-json
8181
$LASTEXITCODE | Should -Be 0
8282
$config_with_process_list = $out | ConvertFrom-Json
83-
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json'
83+
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json'
8484
$config_with_process_list.'resources' | Should -Not -BeNullOrEmpty
8585
$config_with_process_list.resources.count | Should -BeGreaterThan 1
8686
}
8787

8888
It 'Export can be called on a configuration with the use of --format as a subcommand' {
8989

9090
$yaml = @'
91-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
91+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
9292
resources:
9393
- name: Processes
9494
type: Microsoft/Process
@@ -98,7 +98,7 @@ Describe 'resource export tests' {
9898
$out = $yaml | dsc config export -f pretty-json
9999
$LASTEXITCODE | Should -Be 0
100100
$config_with_process_list = $out | ConvertFrom-Json
101-
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json'
101+
$config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json'
102102
$config_with_process_list.'resources' | Should -Not -BeNullOrEmpty
103103
$config_with_process_list.resources.count | Should -BeGreaterThan 1
104104
}

dsc/tests/dsc_functions.tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Describe 'tests for function expressions' {
1414

1515
$escapedText = $text -replace "'", "''"
1616
$config_yaml = @"
17-
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
17+
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
1818
resources:
1919
- name: Echo
2020
type: Test/Echo

0 commit comments

Comments
 (0)