├── .cargo └── config.toml ├── .config └── tsaoptions.json ├── .github ├── ISSUE_TEMPLATE │ ├── Bug_Report.yml │ ├── Feature_Request.yml │ └── config.yml └── workflows │ └── rust.yml ├── .gitignore ├── .pipelines ├── DSC-Official.yml └── DSC-Windows.yml ├── .vscode ├── docs.code-snippets ├── launch.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE.txt ├── README.md ├── SECURITY.md ├── archive ├── file_lib │ ├── Cargo.toml │ ├── cspell.yaml │ └── src │ │ ├── checksum.rs │ │ ├── debug.rs │ │ └── lib.rs ├── ntreg │ ├── Cargo.toml │ ├── build.rs │ ├── src │ │ ├── lib.rs │ │ ├── registry_key.rs │ │ └── registry_value.rs │ └── tests │ │ ├── registry_key_tests.rs │ │ └── registry_value_tests.rs ├── ntstatuserror │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ └── ntstatus_tests.rs ├── ntuserinfo │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ └── ntcurrentuserinfo_tests.rs └── registry │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ ├── registry.dsc.resource.json │ └── src │ ├── args.rs │ ├── bcrypt.rs │ ├── config.rs │ ├── main.rs │ └── regconfighelper.rs ├── build.ps1 ├── configurations └── windows │ ├── copy_files.txt │ ├── windows_baseline.dsc.yaml │ └── windows_inventory.dsc.yaml ├── copy_files.txt ├── docs ├── concepts │ ├── configuration-documents │ │ └── overview.md │ ├── enhanced-authoring.md │ ├── media │ │ └── enhanced-authoring │ │ │ ├── enum-help.png │ │ │ ├── error-messages.png │ │ │ ├── hover-help.png │ │ │ ├── peek-help.png │ │ │ ├── snippet-completion.png │ │ │ └── snippet-selection.png │ ├── output-accessibility.md │ └── resources │ │ ├── anatomy.md │ │ ├── capabilities.md │ │ ├── instances.md │ │ ├── kinds.md │ │ ├── operations.md │ │ ├── overview.md │ │ └── properties.md ├── get-started │ └── index.md ├── glossary.md ├── overview.md └── reference │ ├── cli │ ├── completer │ │ └── index.md │ ├── config │ │ ├── export.md │ │ ├── get.md │ │ ├── index.md │ │ ├── set.md │ │ └── test.md │ ├── index.md │ ├── resource │ │ ├── delete.md │ │ ├── export.md │ │ ├── get.md │ │ ├── index.md │ │ ├── list.md │ │ ├── schema.md │ │ ├── set.md │ │ └── test.md │ └── schema │ │ └── index.md │ ├── resources │ ├── Microsoft │ │ ├── DSC │ │ │ ├── Assertion │ │ │ │ └── index.md │ │ │ ├── Debug │ │ │ │ └── echo │ │ │ │ │ └── index.md │ │ │ ├── Group │ │ │ │ └── index.md │ │ │ ├── Include │ │ │ │ └── index.md │ │ │ ├── PowerShell │ │ │ │ ├── examples │ │ │ │ │ ├── configure-a-machine.md │ │ │ │ │ ├── discovering-powershell-resources.md │ │ │ │ │ └── invoke-a-resource.md │ │ │ │ └── index.md │ │ │ └── Transitional │ │ │ │ └── RunCommandOnSet │ │ │ │ └── index.md │ │ ├── OSInfo │ │ │ ├── examples │ │ │ │ ├── osinfo.config.dsc.yaml │ │ │ │ ├── validate-in-a-configuration.md │ │ │ │ └── validate-with-dsc-resource.md │ │ │ └── index.md │ │ └── Windows │ │ │ ├── RebootPending │ │ │ └── index.md │ │ │ ├── Registry │ │ │ ├── examples │ │ │ │ ├── configure-registry-keys-and-values.md │ │ │ │ ├── manage-a-registry-key.md │ │ │ │ ├── manage-a-registry-value.md │ │ │ │ ├── registry.cleanup.config.dsc.yaml │ │ │ │ └── registry.config.dsc.yaml │ │ │ └── index.md │ │ │ ├── WMI │ │ │ └── index.md │ │ │ └── WindowsPowerShell │ │ │ └── index.md │ └── overview.md │ ├── schemas │ ├── config │ │ ├── document.md │ │ ├── functions │ │ │ ├── add.md │ │ │ ├── base64.md │ │ │ ├── concat.md │ │ │ ├── createArray.md │ │ │ ├── div.md │ │ │ ├── envvar.md │ │ │ ├── format.md │ │ │ ├── int.md │ │ │ ├── max.md │ │ │ ├── min.md │ │ │ ├── mod.md │ │ │ ├── mul.md │ │ │ ├── overview.md │ │ │ ├── parameters.md │ │ │ ├── reference.md │ │ │ ├── resourceId.md │ │ │ ├── sub.md │ │ │ └── variables.md │ │ ├── metadata.md │ │ ├── parameter.md │ │ └── resource.md │ ├── definitions │ │ ├── message.md │ │ ├── parameters │ │ │ └── dataTypes.md │ │ ├── resourceKind.md │ │ └── resourceType.md │ ├── metadata │ │ └── Microsoft.DSC │ │ │ └── properties.md │ ├── outputs │ │ ├── config │ │ │ ├── get.md │ │ │ ├── set.md │ │ │ └── test.md │ │ └── resource │ │ │ ├── get.md │ │ │ ├── list.md │ │ │ ├── set.md │ │ │ └── test.md │ ├── overview.md │ ├── resource │ │ ├── manifest │ │ │ ├── adapter.md │ │ │ ├── delete.md │ │ │ ├── export.md │ │ │ ├── get.md │ │ │ ├── resolve.md │ │ │ ├── root.md │ │ │ ├── schema │ │ │ │ ├── embedded.md │ │ │ │ └── property.md │ │ │ ├── set.md │ │ │ ├── test.md │ │ │ ├── validate.md │ │ │ └── whatif.md │ │ └── properties │ │ │ ├── ensure.md │ │ │ ├── exist.md │ │ │ ├── inDesiredState.md │ │ │ ├── overview.md │ │ │ ├── purge.md │ │ │ └── rebootRequested.md │ └── schema-uris.md │ └── tools │ ├── builtin.md │ ├── osinfo.md │ └── registry │ ├── config │ ├── delete.md │ ├── get.md │ ├── index.md │ └── set.md │ ├── find │ └── index.md │ ├── index.md │ ├── query │ └── index.md │ ├── remove │ └── index.md │ ├── schema │ └── index.md │ └── set │ └── index.md ├── dsc ├── Cargo.lock ├── Cargo.toml ├── README.md ├── assertion.dsc.resource.json ├── copy_files.txt ├── dsc.settings.json ├── dsc_default.settings.json ├── examples │ ├── assertion.dsc.yaml │ ├── brew.dsc.yaml │ ├── brew_export.dsc.yaml │ ├── brew_uninstall.dsc.yaml │ ├── groups.dsc.yaml │ ├── include.dsc.yaml │ ├── invalid_schema.dsc.yaml │ ├── multiline.dsc.yaml │ ├── osinfo.dsc.json │ ├── osinfo.parameters.json │ ├── osinfo.parameters.yaml │ ├── osinfo_parameters.dsc.json │ ├── osinfo_parameters.dsc.yaml │ ├── osinfo_registry.dsc.json │ ├── osinfo_registry.dsc.yaml │ ├── parallel.dsc.yaml │ ├── powershell.dsc.yaml │ ├── reference.dsc.yaml │ ├── require_admin.yaml │ ├── require_nonadmin.yaml │ ├── secure_parameters.dsc.yaml │ ├── secure_parameters.parameters.yaml │ ├── variables.dsc.yaml │ ├── winget.dsc.yaml │ └── winps_script.dsc.yaml ├── group.dsc.resource.json ├── include.dsc.resource.json ├── locales │ └── en-us.toml ├── src │ ├── args.rs │ ├── main.rs │ ├── resolve.rs │ ├── resource_command.rs │ ├── subcommand.rs │ ├── tablewriter.rs │ └── util.rs └── tests │ ├── dsc.exist.tests.ps1 │ ├── dsc.exit_code.tests.ps1 │ ├── dsc_args.tests.ps1 │ ├── dsc_assertion.tests.ps1 │ ├── dsc_brew.tests.ps1 │ ├── dsc_config_get.tests.ps1 │ ├── dsc_config_set.tests.ps1 │ ├── dsc_config_test.tests.ps1 │ ├── dsc_discovery.tests.ps1 │ ├── dsc_export.tests.ps1 │ ├── dsc_expressions.tests.ps1 │ ├── dsc_extension_discover.tests.ps1 │ ├── dsc_functions.tests.ps1 │ ├── dsc_group.tests.ps1 │ ├── dsc_i18n.tests.ps1 │ ├── dsc_include.tests.ps1 │ ├── dsc_osinfo.tests.ps1 │ ├── dsc_parameters.tests.ps1 │ ├── dsc_reference.tests.ps1 │ ├── dsc_resource_get.tests.ps1 │ ├── dsc_resource_input.tests.ps1 │ ├── dsc_resource_list.tests.ps1 │ ├── dsc_resource_test.tests.ps1 │ ├── dsc_schema.tests.ps1 │ ├── dsc_securitycontext.tests.ps1 │ ├── dsc_set.tests.ps1 │ ├── dsc_settings.tests.ps1 │ ├── dsc_test.tests.ps1 │ ├── dsc_tracing.tests.ps1 │ ├── dsc_variables.tests.ps1 │ └── dsc_whatif.tests.ps1 ├── dsc_lib ├── Cargo.lock ├── Cargo.toml ├── locales │ └── en-us.toml └── src │ ├── configure │ ├── config_doc.rs │ ├── config_progress.rs │ ├── config_result.rs │ ├── constraints.rs │ ├── context.rs │ ├── depends_on.rs │ ├── mod.rs │ └── parameters.rs │ ├── discovery │ ├── command_discovery.rs │ ├── discovery_trait.rs │ └── mod.rs │ ├── dscerror.rs │ ├── dscresources │ ├── command_resource.rs │ ├── dscresource.rs │ ├── include.rs │ ├── invoke_result.rs │ ├── mod.rs │ └── resource_manifest.rs │ ├── extensions │ ├── discover.rs │ ├── dscextension.rs │ ├── extension_manifest.rs │ └── mod.rs │ ├── functions │ ├── add.rs │ ├── base64.rs │ ├── concat.rs │ ├── create_array.rs │ ├── div.rs │ ├── envvar.rs │ ├── equals.rs │ ├── format.rs │ ├── if.rs │ ├── int.rs │ ├── max.rs │ ├── min.rs │ ├── mod.rs │ ├── mod_function.rs │ ├── mul.rs │ ├── parameters.rs │ ├── path.rs │ ├── reference.rs │ ├── resource_id.rs │ ├── sub.rs │ ├── system_root.rs │ └── variables.rs │ ├── lib.rs │ ├── parser │ ├── expressions.rs │ ├── functions.rs │ └── mod.rs │ ├── progress.rs │ ├── schemas │ └── mod.rs │ └── util.rs ├── dscecho ├── Cargo.lock ├── Cargo.toml ├── echo.dsc.resource.json ├── locales │ └── en-us.toml └── src │ ├── args.rs │ ├── echo.rs │ └── main.rs ├── extensions ├── appx │ ├── appx-discover.ps1 │ ├── appx.dsc.extension.json │ ├── appx.tests.ps1 │ └── copy_files.txt └── test │ └── discover │ ├── discover.ps1 │ ├── resources │ ├── testDiscoveredOne.dsc.resource.json │ └── testDiscoveredTwo.dsc.resource.json │ └── testDiscover.dsc.extension.json ├── osinfo ├── Cargo.lock ├── Cargo.toml ├── README.md ├── osinfo.dsc.resource.json ├── src │ ├── config.rs │ └── main.rs └── tests │ └── osinfo.tests.ps1 ├── packaging ├── assets │ ├── Square150x150Logo.png │ ├── Square44x44Logo.png │ ├── Square44x44Logo.targetsize-48.png │ ├── Square44x44Logo.targetsize-48_altform-unplated.png │ ├── Square64x64Logo.png │ └── StoreLogo.png └── msix │ └── AppxManifest.xml ├── pal ├── .gitignore ├── Cargo.toml ├── build.rs ├── ext-ms-win-cng-rng-l1-1-0.def └── src │ ├── lib.rs │ └── windows.rs ├── powershell-adapter ├── Tests │ ├── PSTestModule │ │ └── 1.0.0 │ │ │ ├── DscResources │ │ │ └── TestPSRepository │ │ │ │ ├── TestPSRepository.psm1 │ │ │ │ └── TestPSRepository.schema.mof │ │ │ └── PSTestModule.psd1 │ ├── TestAdapter │ │ ├── testadapter.dsc.resource.json │ │ └── testadapter.resource.ps1 │ ├── TestClassResource │ │ └── 0.0.1 │ │ │ ├── TestClassResource.psd1 │ │ │ └── TestClassResource.psm1 │ ├── class_ps_resources.dsc.yaml │ ├── native_and_powershell.dsc.yaml │ ├── powershellgroup.config.tests.ps1 │ ├── powershellgroup.resource.tests.ps1 │ ├── win_powershellgroup.tests.ps1 │ ├── winps_reference_resource.dsc.yaml │ └── winps_resource.dsc.yaml ├── copy_files.txt ├── powershell.dsc.resource.json ├── psDscAdapter │ ├── powershell.resource.ps1 │ ├── psDscAdapter.psd1 │ ├── psDscAdapter.psm1 │ ├── win_psDscAdapter.psd1 │ └── win_psDscAdapter.psm1 └── windowspowershell.dsc.resource.json ├── process ├── Cargo.lock ├── Cargo.toml ├── ExportTest.dsc.yaml ├── process.dsc.resource.json └── src │ ├── main.rs │ └── process_info.rs ├── reboot_pending ├── copy_files.txt ├── reboot_pending.dsc.resource.json ├── reboot_pending.resource.ps1 └── tests │ ├── reboot_pending.dsc.yaml │ └── reboot_pending.tests.ps1 ├── registry ├── Cargo.lock ├── Cargo.toml ├── build.rs ├── locales │ └── en-us.toml ├── registry.dsc.resource.json ├── src │ ├── args.rs │ ├── config.rs │ ├── error.rs │ ├── main.rs │ └── registry_helper.rs └── tests │ ├── registry.config.get.tests.ps1 │ ├── registry.config.set.tests.ps1 │ └── registry.config.whatif.tests.ps1 ├── resources ├── Microsoft.DSC.Experimental │ └── 0.0.1 │ │ ├── Microsoft.DSC.Experimental.Systemctl.psm1 │ │ └── Microsoft.DSC.Experimental.psd1 ├── apt │ ├── apt.dsc.resource.json │ ├── apt.dsc.resource.sh │ ├── copy_files.txt │ └── test │ │ ├── apt.tests.ps1 │ │ └── assets │ │ ├── apt_install_rolldice.dsc.yaml │ │ ├── apt_uninstall_rolldice.dsc.yaml │ │ └── apt_wget.dsc.yaml └── brew │ ├── brew.dsc.resource.json │ ├── brew.dsc.resource.sh │ └── copy_files.txt ├── runcommandonset ├── Cargo.lock ├── Cargo.toml ├── RunCommandOnSet.dsc.resource.json ├── locales │ └── en-us.toml ├── src │ ├── args.rs │ ├── main.rs │ ├── runcommand.rs │ └── utils.rs └── tests │ ├── runcommandonset.get.tests.ps1 │ └── runcommandonset.set.tests.ps1 ├── schemas ├── 2023 │ ├── 10 │ │ ├── bundled │ │ │ ├── config │ │ │ │ ├── document.json │ │ │ │ └── document.vscode.json │ │ │ ├── outputs │ │ │ │ ├── config │ │ │ │ │ ├── get.json │ │ │ │ │ ├── set.json │ │ │ │ │ └── test.json │ │ │ │ ├── resource │ │ │ │ │ ├── get.json │ │ │ │ │ ├── list.json │ │ │ │ │ ├── schema.json │ │ │ │ │ ├── set.json │ │ │ │ │ └── test.json │ │ │ │ └── schema.json │ │ │ └── resource │ │ │ │ ├── manifest.json │ │ │ │ └── manifest.vscode.json │ │ ├── config │ │ │ ├── document.json │ │ │ ├── document.parameter.json │ │ │ └── document.resource.json │ │ ├── definitions │ │ │ ├── commandArgs.json │ │ │ ├── commandExecutable.json │ │ │ ├── hadErrors.json │ │ │ ├── inputKind.json │ │ │ ├── instanceName.json │ │ │ ├── message.json │ │ │ ├── messages.json │ │ │ ├── parameters │ │ │ │ ├── dataTypes.json │ │ │ │ └── validValueTypes.json │ │ │ ├── resourceType.json │ │ │ ├── returnKind.json │ │ │ └── semver.json │ │ ├── outputs │ │ │ ├── config │ │ │ │ ├── get.json │ │ │ │ ├── set.json │ │ │ │ └── test.json │ │ │ ├── resource │ │ │ │ ├── get.full.json │ │ │ │ ├── get.json │ │ │ │ ├── get.simple.json │ │ │ │ ├── list.json │ │ │ │ ├── schema.json │ │ │ │ ├── set.full.json │ │ │ │ ├── set.json │ │ │ │ ├── set.simple.json │ │ │ │ ├── test.full.json │ │ │ │ ├── test.json │ │ │ │ └── test.simple.json │ │ │ └── schema.json │ │ └── resource │ │ │ ├── manifest.export.json │ │ │ ├── manifest.get.json │ │ │ ├── manifest.json │ │ │ ├── manifest.provider.json │ │ │ ├── manifest.schema.json │ │ │ ├── manifest.set.json │ │ │ ├── manifest.test.json │ │ │ ├── manifest.validate.json │ │ │ └── properties │ │ │ ├── exist.json │ │ │ ├── inDesiredState.json │ │ │ ├── purge.json │ │ │ └── rebootRequested.json │ └── 08 │ │ ├── bundled │ │ ├── config │ │ │ ├── document.json │ │ │ └── document.vscode.json │ │ ├── outputs │ │ │ ├── config │ │ │ │ ├── get.json │ │ │ │ ├── set.json │ │ │ │ └── test.json │ │ │ ├── resource │ │ │ │ ├── get.json │ │ │ │ ├── list.json │ │ │ │ ├── schema.json │ │ │ │ ├── set.json │ │ │ │ └── test.json │ │ │ └── schema.json │ │ └── resource │ │ │ ├── manifest.json │ │ │ └── manifest.vscode.json │ │ ├── config │ │ ├── document.json │ │ ├── document.parameter.json │ │ └── document.resource.json │ │ ├── definitions │ │ ├── commandArgs.json │ │ ├── commandExecutable.json │ │ ├── hadErrors.json │ │ ├── inputKind.json │ │ ├── instanceName.json │ │ ├── message.json │ │ ├── messages.json │ │ ├── parameters │ │ │ ├── dataTypes.json │ │ │ └── validValueTypes.json │ │ ├── resourceType.json │ │ ├── returnKind.json │ │ └── semver.json │ │ ├── outputs │ │ ├── config │ │ │ ├── get.json │ │ │ ├── set.json │ │ │ └── test.json │ │ ├── resource │ │ │ ├── get.json │ │ │ ├── list.json │ │ │ ├── schema.json │ │ │ ├── set.json │ │ │ └── test.json │ │ └── schema.json │ │ └── resource │ │ ├── manifest.export.json │ │ ├── manifest.get.json │ │ ├── manifest.json │ │ ├── manifest.provider.json │ │ ├── manifest.schema.json │ │ ├── manifest.set.json │ │ ├── manifest.test.json │ │ ├── manifest.validate.json │ │ └── properties │ │ ├── ensure.json │ │ ├── inDesiredState.json │ │ ├── purge.json │ │ └── rebootRequested.json ├── 2024 │ └── 04 │ │ ├── bundled │ │ ├── config │ │ │ ├── document.json │ │ │ └── document.vscode.json │ │ ├── outputs │ │ │ ├── config │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── resource │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── list.json │ │ │ │ ├── list.vscode.json │ │ │ │ ├── schema.json │ │ │ │ ├── schema.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── schema.json │ │ │ └── schema.vscode.json │ │ └── resource │ │ │ ├── manifest.json │ │ │ └── manifest.vscode.json │ │ ├── config │ │ ├── document.json │ │ ├── document.metadata.json │ │ ├── document.parameter.json │ │ └── document.resource.json │ │ ├── definitions │ │ ├── commandArgs.json │ │ ├── commandExecutable.json │ │ ├── hadErrors.json │ │ ├── inputKind.json │ │ ├── instanceName.json │ │ ├── message.json │ │ ├── messages.json │ │ ├── parameters │ │ │ ├── dataTypes.json │ │ │ └── validValueTypes.json │ │ ├── resourceKind.json │ │ ├── resourceType.json │ │ ├── returnKind.json │ │ └── semver.json │ │ ├── metadata │ │ ├── Microsoft.DSC │ │ │ ├── duration.json │ │ │ ├── endDatetime.json │ │ │ ├── executionType.json │ │ │ ├── operation.json │ │ │ ├── securityContext.json │ │ │ ├── startDatetime.json │ │ │ └── version.json │ │ ├── configurationDocumentResult.json │ │ └── resourceInstanceResult.json │ │ ├── outputs │ │ ├── config │ │ │ ├── get.json │ │ │ ├── set.json │ │ │ └── test.json │ │ ├── resource │ │ │ ├── get.full.json │ │ │ ├── get.json │ │ │ ├── get.simple.json │ │ │ ├── list.json │ │ │ ├── schema.json │ │ │ ├── set.full.json │ │ │ ├── set.json │ │ │ ├── set.simple.json │ │ │ ├── test.full.json │ │ │ ├── test.json │ │ │ └── test.simple.json │ │ └── schema.json │ │ └── resource │ │ ├── manifest.adapter.json │ │ ├── manifest.delete.json │ │ ├── manifest.export.json │ │ ├── manifest.get.json │ │ ├── manifest.json │ │ ├── manifest.resolve.json │ │ ├── manifest.schema.json │ │ ├── manifest.set.json │ │ ├── manifest.test.json │ │ ├── manifest.validate.json │ │ ├── manifest.whatIf.json │ │ └── properties │ │ ├── exist.json │ │ ├── inDesiredState.json │ │ ├── purge.json │ │ └── rebootRequested.json ├── build.ps1 ├── examples │ ├── configuration_document │ │ └── example.dsc.config.yaml │ ├── output │ │ ├── config.get.yaml │ │ └── config.test.yaml │ └── resource_manifest │ │ ├── foo.dsc.resource.json │ │ └── foo.dsc.resource.yaml ├── resources │ └── Microsoft │ │ └── OSInfo │ │ └── v0.1.0 │ │ ├── schema.json │ │ └── schema.yaml ├── schemas.config.yaml ├── src │ ├── config │ │ ├── document.metadata.yaml │ │ ├── document.parameter.yaml │ │ ├── document.resource.yaml │ │ └── document.yaml │ ├── definitions │ │ ├── commandArgs.yaml │ │ ├── commandExecutable.yaml │ │ ├── hadErrors.yaml │ │ ├── inputKind.yaml │ │ ├── instanceName.yaml │ │ ├── message.yaml │ │ ├── messages.yaml │ │ ├── parameters │ │ │ ├── dataTypes.yaml │ │ │ └── validValueTypes.yaml │ │ ├── resourceCapabilities.yaml │ │ ├── resourceKind.yaml │ │ ├── resourceType.yaml │ │ ├── returnKind.yaml │ │ └── semver.yaml │ ├── metadata │ │ ├── Microsoft.DSC │ │ │ ├── context.yaml │ │ │ ├── duration.yaml │ │ │ ├── endDatetime.yaml │ │ │ ├── executionType.yaml │ │ │ ├── operation.yaml │ │ │ ├── securityContext.yaml │ │ │ ├── startDatetime.yaml │ │ │ └── version.yaml │ │ ├── configurationDocumentResult.yaml │ │ └── resourceInstanceResult.yaml │ ├── outputs │ │ ├── config │ │ │ ├── get.yaml │ │ │ ├── set.yaml │ │ │ └── test.yaml │ │ ├── resource │ │ │ ├── get.full.yaml │ │ │ ├── get.simple.yaml │ │ │ ├── get.yaml │ │ │ ├── list.yaml │ │ │ ├── schema.yaml │ │ │ ├── set.full.yaml │ │ │ ├── set.simple.yaml │ │ │ ├── set.yaml │ │ │ ├── test.full.yaml │ │ │ ├── test.simple.yaml │ │ │ └── test.yaml │ │ └── schema.yaml │ └── resource │ │ ├── manifest.adapter.yaml │ │ ├── manifest.delete.yaml │ │ ├── manifest.export.yaml │ │ ├── manifest.get.yaml │ │ ├── manifest.resolve.yaml │ │ ├── manifest.schema.yaml │ │ ├── manifest.set.yaml │ │ ├── manifest.test.yaml │ │ ├── manifest.validate.yaml │ │ ├── manifest.whatIf.yaml │ │ ├── manifest.yaml │ │ ├── properties │ │ ├── exist.yaml │ │ ├── inDesiredState.yaml │ │ ├── purge.yaml │ │ └── rebootRequested.yaml │ │ └── stdout │ │ ├── delete.yaml │ │ ├── export.yaml │ │ ├── get.yaml │ │ ├── list.yaml │ │ ├── resolve.yaml │ │ ├── schema.yaml │ │ ├── set.yaml │ │ ├── test.yaml │ │ ├── validate.yaml │ │ └── whatIf.yaml ├── v3.0.0 │ ├── bundled │ │ ├── config │ │ │ ├── document.json │ │ │ └── document.vscode.json │ │ ├── outputs │ │ │ ├── config │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── resource │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── list.json │ │ │ │ ├── list.vscode.json │ │ │ │ ├── schema.json │ │ │ │ ├── schema.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── schema.json │ │ │ └── schema.vscode.json │ │ └── resource │ │ │ ├── manifest.json │ │ │ └── manifest.vscode.json │ ├── config │ │ ├── document.json │ │ ├── document.metadata.json │ │ ├── document.parameter.json │ │ └── document.resource.json │ ├── definitions │ │ ├── commandArgs.json │ │ ├── commandExecutable.json │ │ ├── hadErrors.json │ │ ├── inputKind.json │ │ ├── instanceName.json │ │ ├── message.json │ │ ├── messages.json │ │ ├── parameters │ │ │ ├── dataTypes.json │ │ │ └── validValueTypes.json │ │ ├── resourceCapabilities.json │ │ ├── resourceKind.json │ │ ├── resourceType.json │ │ ├── returnKind.json │ │ └── semver.json │ ├── metadata │ │ ├── Microsoft.DSC │ │ │ ├── context.json │ │ │ ├── duration.json │ │ │ ├── endDatetime.json │ │ │ ├── executionType.json │ │ │ ├── operation.json │ │ │ ├── securityContext.json │ │ │ ├── startDatetime.json │ │ │ └── version.json │ │ ├── configurationDocumentResult.json │ │ └── resourceInstanceResult.json │ ├── outputs │ │ ├── config │ │ │ ├── get.json │ │ │ ├── set.json │ │ │ └── test.json │ │ ├── resource │ │ │ ├── get.full.json │ │ │ ├── get.json │ │ │ ├── get.simple.json │ │ │ ├── list.json │ │ │ ├── schema.json │ │ │ ├── set.full.json │ │ │ ├── set.json │ │ │ ├── set.simple.json │ │ │ ├── test.full.json │ │ │ ├── test.json │ │ │ └── test.simple.json │ │ └── schema.json │ └── resource │ │ ├── manifest.adapter.json │ │ ├── manifest.delete.json │ │ ├── manifest.export.json │ │ ├── manifest.get.json │ │ ├── manifest.json │ │ ├── manifest.resolve.json │ │ ├── manifest.schema.json │ │ ├── manifest.set.json │ │ ├── manifest.test.json │ │ ├── manifest.validate.json │ │ ├── manifest.whatIf.json │ │ ├── properties │ │ ├── exist.json │ │ ├── inDesiredState.json │ │ ├── purge.json │ │ └── rebootRequested.json │ │ └── stdout │ │ ├── delete.json │ │ ├── export.json │ │ ├── get.json │ │ ├── list.json │ │ ├── resolve.json │ │ ├── schema.json │ │ ├── set.json │ │ ├── test.json │ │ ├── validate.json │ │ └── whatIf.json ├── v3.0 │ ├── bundled │ │ ├── config │ │ │ ├── document.json │ │ │ └── document.vscode.json │ │ ├── outputs │ │ │ ├── config │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── resource │ │ │ │ ├── get.json │ │ │ │ ├── get.vscode.json │ │ │ │ ├── list.json │ │ │ │ ├── list.vscode.json │ │ │ │ ├── schema.json │ │ │ │ ├── schema.vscode.json │ │ │ │ ├── set.json │ │ │ │ ├── set.vscode.json │ │ │ │ ├── test.json │ │ │ │ └── test.vscode.json │ │ │ ├── schema.json │ │ │ └── schema.vscode.json │ │ └── resource │ │ │ ├── manifest.json │ │ │ └── manifest.vscode.json │ ├── config │ │ ├── document.json │ │ ├── document.metadata.json │ │ ├── document.parameter.json │ │ └── document.resource.json │ ├── definitions │ │ ├── commandArgs.json │ │ ├── commandExecutable.json │ │ ├── hadErrors.json │ │ ├── inputKind.json │ │ ├── instanceName.json │ │ ├── message.json │ │ ├── messages.json │ │ ├── parameters │ │ │ ├── dataTypes.json │ │ │ └── validValueTypes.json │ │ ├── resourceCapabilities.json │ │ ├── resourceKind.json │ │ ├── resourceType.json │ │ ├── returnKind.json │ │ └── semver.json │ ├── metadata │ │ ├── Microsoft.DSC │ │ │ ├── context.json │ │ │ ├── duration.json │ │ │ ├── endDatetime.json │ │ │ ├── executionType.json │ │ │ ├── operation.json │ │ │ ├── securityContext.json │ │ │ ├── startDatetime.json │ │ │ └── version.json │ │ ├── configurationDocumentResult.json │ │ └── resourceInstanceResult.json │ ├── outputs │ │ ├── config │ │ │ ├── get.json │ │ │ ├── set.json │ │ │ └── test.json │ │ ├── resource │ │ │ ├── get.full.json │ │ │ ├── get.json │ │ │ ├── get.simple.json │ │ │ ├── list.json │ │ │ ├── schema.json │ │ │ ├── set.full.json │ │ │ ├── set.json │ │ │ ├── set.simple.json │ │ │ ├── test.full.json │ │ │ ├── test.json │ │ │ └── test.simple.json │ │ └── schema.json │ └── resource │ │ ├── manifest.adapter.json │ │ ├── manifest.delete.json │ │ ├── manifest.export.json │ │ ├── manifest.get.json │ │ ├── manifest.json │ │ ├── manifest.resolve.json │ │ ├── manifest.schema.json │ │ ├── manifest.set.json │ │ ├── manifest.test.json │ │ ├── manifest.validate.json │ │ ├── manifest.whatIf.json │ │ ├── properties │ │ ├── exist.json │ │ ├── inDesiredState.json │ │ ├── purge.json │ │ └── rebootRequested.json │ │ └── stdout │ │ ├── delete.json │ │ ├── export.json │ │ ├── get.json │ │ ├── list.json │ │ ├── resolve.json │ │ ├── schema.json │ │ ├── set.json │ │ ├── test.json │ │ ├── validate.json │ │ └── whatIf.json └── v3 │ ├── bundled │ ├── config │ │ ├── document.json │ │ └── document.vscode.json │ ├── outputs │ │ ├── config │ │ │ ├── get.json │ │ │ ├── get.vscode.json │ │ │ ├── set.json │ │ │ ├── set.vscode.json │ │ │ ├── test.json │ │ │ └── test.vscode.json │ │ ├── resource │ │ │ ├── get.json │ │ │ ├── get.vscode.json │ │ │ ├── list.json │ │ │ ├── list.vscode.json │ │ │ ├── schema.json │ │ │ ├── schema.vscode.json │ │ │ ├── set.json │ │ │ ├── set.vscode.json │ │ │ ├── test.json │ │ │ └── test.vscode.json │ │ ├── schema.json │ │ └── schema.vscode.json │ └── resource │ │ ├── manifest.json │ │ └── manifest.vscode.json │ ├── config │ ├── document.json │ ├── document.metadata.json │ ├── document.parameter.json │ └── document.resource.json │ ├── definitions │ ├── commandArgs.json │ ├── commandExecutable.json │ ├── hadErrors.json │ ├── inputKind.json │ ├── instanceName.json │ ├── message.json │ ├── messages.json │ ├── parameters │ │ ├── dataTypes.json │ │ └── validValueTypes.json │ ├── resourceCapabilities.json │ ├── resourceKind.json │ ├── resourceType.json │ ├── returnKind.json │ └── semver.json │ ├── metadata │ ├── Microsoft.DSC │ │ ├── context.json │ │ ├── duration.json │ │ ├── endDatetime.json │ │ ├── executionType.json │ │ ├── operation.json │ │ ├── securityContext.json │ │ ├── startDatetime.json │ │ └── version.json │ ├── configurationDocumentResult.json │ └── resourceInstanceResult.json │ ├── outputs │ ├── config │ │ ├── get.json │ │ ├── set.json │ │ └── test.json │ ├── resource │ │ ├── get.full.json │ │ ├── get.json │ │ ├── get.simple.json │ │ ├── list.json │ │ ├── schema.json │ │ ├── set.full.json │ │ ├── set.json │ │ ├── set.simple.json │ │ ├── test.full.json │ │ ├── test.json │ │ └── test.simple.json │ └── schema.json │ └── resource │ ├── manifest.adapter.json │ ├── manifest.delete.json │ ├── manifest.export.json │ ├── manifest.get.json │ ├── manifest.json │ ├── manifest.resolve.json │ ├── manifest.schema.json │ ├── manifest.set.json │ ├── manifest.test.json │ ├── manifest.validate.json │ ├── manifest.whatIf.json │ ├── properties │ ├── exist.json │ ├── inDesiredState.json │ ├── purge.json │ └── rebootRequested.json │ └── stdout │ ├── delete.json │ ├── export.json │ ├── get.json │ ├── list.json │ ├── resolve.json │ ├── schema.json │ ├── set.json │ ├── test.json │ ├── validate.json │ └── whatIf.json ├── security_context_lib ├── Cargo.lock ├── Cargo.toml └── src │ └── lib.rs ├── tools ├── dsctest │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── dscdelete.dsc.resource.json │ ├── dscexist.dsc.resource.json │ ├── dscexitcode.dsc.resource.json │ ├── dscexport.dsc.resource.json │ ├── dscexporter.dsc.resource.json │ ├── dscindesiredstate.dsc.resource.json │ ├── dscsleep.dsc.resource.json │ ├── dsctrace.dsc.resource.json │ ├── dscwhatif.dsc.resource.json │ └── src │ │ ├── args.rs │ │ ├── delete.rs │ │ ├── exist.rs │ │ ├── exit_code.rs │ │ ├── export.rs │ │ ├── exporter.rs │ │ ├── in_desired_state.rs │ │ ├── main.rs │ │ ├── sleep.rs │ │ ├── trace.rs │ │ └── whatif.rs └── test_group_resource │ ├── Cargo.lock │ ├── Cargo.toml │ ├── src │ ├── args.rs │ └── main.rs │ ├── testGroup.dsc.resource.json │ └── tests │ └── provider.tests.ps1 ├── tree-sitter-dscexpression ├── .gitattributes ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.ps1 ├── grammar.js ├── package.json ├── test │ └── corpus │ │ ├── invalid_expressions.txt │ │ └── valid_expressions.txt └── tree-sitter.json ├── wmi-adapter ├── Tests │ ├── test_wmi_config.dsc.yaml │ └── wmi.tests.ps1 ├── copy_files.txt ├── wmi.dsc.resource.json └── wmi.resource.ps1 └── y2j ├── Cargo.lock ├── Cargo.toml ├── README.md └── src └── main.rs /.config/tsaoptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "instanceUrl": "https://msazure.visualstudio.com", 3 | "projectName": "One", 4 | "areaPath": "One\\MGMT\\Compute\\PowerShell Desired State Configuration", 5 | "notificationAliases": [ 6 | "tessgauthier@microsoft.com", 7 | "slee@microsoft.com" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask a question 4 | url: https://github.com/PowerShell/DSC/discussions/new?category=q-a 5 | about: >- 6 | If you have a question about DSC, the docs, or this project, ask it here. 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | bin/ 3 | .DS_Store 4 | *.msix 5 | 6 | # Node.js generated files for tree-sitter 7 | build/ 8 | node_modules/ 9 | tree-sitter-dscexpression/bindings/ 10 | tree-sitter-dscexpression/src/ 11 | tree-sitter-dscexpression/parser.* 12 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | - Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) 11 | -------------------------------------------------------------------------------- /archive/file_lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "file_lib" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | crossterm = "0.27.0" 10 | digest = "0.10.7" 11 | hex-string = "0.1.0" 12 | sha1 = "0.10.6" 13 | sha2 = "0.10.8" 14 | -------------------------------------------------------------------------------- /archive/file_lib/cspell.yaml: -------------------------------------------------------------------------------- 1 | words: 2 | - crossterm 3 | - hasher 4 | -------------------------------------------------------------------------------- /archive/file_lib/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | pub use self::checksum::Algorithm; 5 | pub use self::checksum::compute; 6 | pub use self::debug::check_debugger_prompt; 7 | 8 | pub mod checksum; 9 | pub mod debug; 10 | -------------------------------------------------------------------------------- /archive/ntreg/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ntreg" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | strip = true 8 | # optimize for size 9 | opt-level = 2 10 | # enable link time optimization to remove dead code 11 | lto = true 12 | 13 | [profile.dev] 14 | opt-level = 0 15 | debug = true 16 | debug-assertions = true 17 | overflow-checks = true 18 | lto = false 19 | panic = 'unwind' 20 | incremental = true 21 | codegen-units = 256 22 | rpath = false 23 | 24 | [dependencies] 25 | ntapi = { version = "0.4.0" } 26 | ntstatuserror = { path = "../ntstatuserror" } 27 | ntuserinfo = { path = "../ntuserinfo" } 28 | thiserror = "1.0" 29 | 30 | [target.'cfg(onecore)'.dependencies] 31 | pal = { path = "../pal" } 32 | 33 | [build-dependencies] 34 | static_vcruntime = "2.0" 35 | -------------------------------------------------------------------------------- /archive/ntreg/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | #[cfg(onecore)] 5 | fn main() { 6 | // Prevent this build script from rerunning unnecessarily. 7 | println!("cargo:rerun-if-changed=build.rs"); 8 | println!("cargo:rustc-link-lib=onecore_apiset"); 9 | println!("cargo:rustc-link-lib=onecoreuap_apiset"); 10 | static_vcruntime::metabuild(); 11 | } 12 | 13 | #[cfg(not(onecore))] 14 | fn main() { 15 | println!("cargo:rerun-if-changed=build.rs"); 16 | static_vcruntime::metabuild(); 17 | } 18 | -------------------------------------------------------------------------------- /archive/ntstatuserror/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ntstatuserror" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | ntapi = { version = "0.4.0" } 10 | thiserror = "1.0" 11 | -------------------------------------------------------------------------------- /archive/ntstatuserror/tests/ntstatus_tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | extern crate ntstatuserror; 5 | use ntapi::winapi::shared::ntstatus::{STATUS_OBJECT_NAME_NOT_FOUND}; 6 | use ntstatuserror::NtStatusError; 7 | 8 | #[cfg(test)] 9 | 10 | #[test] 11 | fn test_from_ntstatus() { 12 | let error = NtStatusError::new(STATUS_OBJECT_NAME_NOT_FOUND, "Test"); 13 | assert_eq!(error.status, ntstatuserror::NtStatusErrorKind::ObjectNameNotFound); 14 | assert_eq!(error.message, "Test".to_string()); 15 | } 16 | -------------------------------------------------------------------------------- /archive/ntuserinfo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ntuserinfo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | ntapi = { version = "0.4.0" } 10 | ntstatuserror = { path = "../ntstatuserror" } 11 | -------------------------------------------------------------------------------- /archive/ntuserinfo/tests/ntcurrentuserinfo_tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | extern crate ntuserinfo; 5 | use ntuserinfo::NtCurrentUserInfo; 6 | 7 | #[cfg(test)] 8 | 9 | #[test] 10 | fn test_get_current_user_sid() { 11 | let user = NtCurrentUserInfo::new(); 12 | assert!(user.is_ok()); 13 | let user = user.unwrap(); 14 | assert!(user.sid.starts_with("S-")); 15 | // validate it's in the form of a SID 16 | assert!(user.sid.split('-').count() > 2); 17 | // validate the last part is a number 18 | assert!(user.sid.split('-').last().unwrap().parse::().is_ok()); 19 | } 20 | -------------------------------------------------------------------------------- /archive/registry/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "registry" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | strip = true 8 | # optimize for size 9 | opt-level = 2 10 | # enable link time optimization to remove dead code 11 | lto = true 12 | 13 | [profile.dev] 14 | lto = true 15 | 16 | [dependencies] 17 | atty = { version = "0.2" } 18 | clap = { version = "4.1", features = ["derive"] } 19 | crossterm = { version = "0.26" } 20 | ntreg = { path = "../ntreg" } 21 | ntstatuserror = { path = "../ntstatuserror" } 22 | schemars = { version = "0.8" } 23 | serde = { version = "1.0", features = ["derive"] } 24 | serde_json = { version = "1.0", features = ["preserve_order"] } 25 | 26 | [target.'cfg(onecore)'.dependencies] 27 | pal = { path = "../pal" } 28 | 29 | [build-dependencies] 30 | static_vcruntime = "2.0" 31 | -------------------------------------------------------------------------------- /archive/registry/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | #[cfg(onecore)] 5 | fn main() { 6 | // Prevent this build script from rerunning unnecessarily. 7 | println!("cargo:rerun-if-changed=build.rs"); 8 | println!("cargo:rustc-link-lib=onecore_apiset"); 9 | println!("cargo:rustc-link-lib=onecoreuap_apiset"); 10 | static_vcruntime::metabuild(); 11 | } 12 | 13 | #[cfg(not(onecore))] 14 | fn main() { 15 | // Prevent this build script from rerunning unnecessarily. 16 | println!("cargo:rerun-if-changed=build.rs"); 17 | static_vcruntime::metabuild(); 18 | } 19 | -------------------------------------------------------------------------------- /configurations/windows/copy_files.txt: -------------------------------------------------------------------------------- 1 | windows_baseline.dsc.yaml 2 | windows_inventory.dsc.yaml -------------------------------------------------------------------------------- /copy_files.txt: -------------------------------------------------------------------------------- 1 | NOTICE.txt 2 | -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/enum-help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/enum-help.png -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/error-messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/error-messages.png -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/hover-help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/hover-help.png -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/peek-help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/peek-help.png -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/snippet-completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/snippet-completion.png -------------------------------------------------------------------------------- /docs/concepts/media/enhanced-authoring/snippet-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/concepts/media/enhanced-authoring/snippet-selection.png -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/Assertion/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/Assertion/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/Debug/echo/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/Debug/echo/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/Group/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/Group/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/Include/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/Include/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/PowerShell/examples/configure-a-machine.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/PowerShell/examples/configure-a-machine.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/PowerShell/examples/discovering-powershell-resources.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/PowerShell/examples/discovering-powershell-resources.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/PowerShell/examples/invoke-a-resource.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/PowerShell/examples/invoke-a-resource.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/DSC/Transitional/RunCommandOnSet/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/DSC/Transitional/RunCommandOnSet/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/OSInfo/examples/osinfo.config.dsc.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: Operating System Assertion 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: Is64BitOS 10 | type: Microsoft/OSInfo 11 | properties: 12 | bitness: '32' 13 | -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/Windows/RebootPending/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/Windows/RebootPending/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/Windows/Registry/examples/registry.cleanup.config.dsc.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: Remove DscExamples key remaining subkeys or values 5 | type: Microsoft.Windows/Registry 6 | properties: 7 | _exist: false 8 | keyPath: HKCU\DscExamples 9 | -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/Windows/Registry/examples/registry.config.dsc.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: Managed key 5 | type: Microsoft.Windows/Registry 6 | properties: 7 | _exist: true 8 | keyPath: HKCU\DscExamples\ManagedKey 9 | - name: Managed value 10 | type: Microsoft.Windows/Registry 11 | properties: 12 | _exist: true 13 | keyPath: HKCU\DscExamples 14 | valueName: ManagedValue 15 | valueData: 16 | String: Default 17 | -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/Windows/WMI/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/Windows/WMI/index.md -------------------------------------------------------------------------------- /docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md -------------------------------------------------------------------------------- /dsc/copy_files.txt: -------------------------------------------------------------------------------- 1 | dsc.settings.json 2 | dsc_default.settings.json 3 | -------------------------------------------------------------------------------- /dsc/dsc.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourcePath": { 3 | "allowEnvOverride": true, 4 | "appendEnvPath": true, 5 | "directories": [] 6 | }, 7 | "tracing": { 8 | "level": "WARN", 9 | "format": "Default", 10 | "allowOverride": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dsc/dsc_default.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "1": { 3 | "resourcePath": { 4 | "allowEnvOverride": true, 5 | "appendEnvPath": true, 6 | "directories": [] 7 | }, 8 | "tracing": { 9 | "level": "WARN", 10 | "format": "Default", 11 | "allowOverride": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dsc/examples/brew.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: assertions 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: os_check 10 | type: Microsoft/OSInfo 11 | properties: 12 | family: macOS 13 | - name: brew 14 | type: DSC.PackageManagement/Brew 15 | properties: 16 | packageName: gitui 17 | _exist: true 18 | dependsOn: 19 | - "[resourceId('Microsoft.DSC/Assertion','assertions')]" 20 | -------------------------------------------------------------------------------- /dsc/examples/brew_export.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: brew 5 | type: DSC.PackageManagement/Brew 6 | properties: 7 | packageName: none 8 | -------------------------------------------------------------------------------- /dsc/examples/brew_uninstall.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: assertions 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: os_check 10 | type: Microsoft/OSInfo 11 | properties: 12 | family: macOS 13 | - name: brew 14 | type: DSC.PackageManagement/Brew 15 | properties: 16 | packageName: gitui 17 | _exist: false 18 | dependsOn: 19 | - "[resourceId('Microsoft.DSC/Assertion','assertions')]" 20 | -------------------------------------------------------------------------------- /dsc/examples/include.dsc.yaml: -------------------------------------------------------------------------------- 1 | # This is a simple example of how to Include another configuration into this one 2 | 3 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 4 | resources: 5 | - name: get os info 6 | type: Microsoft.DSC/Include 7 | properties: 8 | configurationFile: osinfo_parameters.dsc.yaml 9 | parametersFile: osinfo.parameters.yaml 10 | -------------------------------------------------------------------------------- /dsc/examples/invalid_schema.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Sample configuration with invalid properties that don't match the resource schema. 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: os 5 | type: Microsoft/OSInfo 6 | properties: {} 7 | - name: windows product name 8 | type: Microsoft.Windows/Registry 9 | properties: 10 | kyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion 11 | valueName: ProductName 12 | - name: powershell version 13 | type: Microsoft.Windows/Registry 14 | properties: 15 | keyPath: HKLM\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\86abcfbd-1ccc-4a88-b8b2-0facfde29094 16 | valueNamed: SemanticVersion 17 | -------------------------------------------------------------------------------- /dsc/examples/multiline.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | resources: 3 | - name: test multi-line 4 | type: Microsoft.DSC.Debug/Echo 5 | properties: 6 | output: | 7 | This is a 8 | 'multi-line' 9 | string. 10 | - name: test single-quote escaping 11 | type: Microsoft.DSC.Debug/Echo 12 | properties: 13 | output: "[concat('This is a single-quote: ', '''')]" 14 | -------------------------------------------------------------------------------- /dsc/examples/osinfo.dsc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json", 3 | "resources": [ 4 | { 5 | "name": "os", 6 | "type": "Microsoft/OSInfo", 7 | "properties": { 8 | "family": "Windows" 9 | } 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /dsc/examples/osinfo.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "parameters": { 3 | "osFamily": "macOS" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /dsc/examples/osinfo.parameters.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | osFamily: macOS 3 | -------------------------------------------------------------------------------- /dsc/examples/osinfo_parameters.dsc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json", 3 | "parameters": { 4 | "osFamily": { 5 | "type": "string", 6 | "defaultValue": "[concat('Win','dows')]", 7 | "allowedValues": [ 8 | "Windows", 9 | "Linux", 10 | "macOS" 11 | ] 12 | } 13 | }, 14 | "resources": [ 15 | { 16 | "name": "os", 17 | "type": "Microsoft/OSInfo", 18 | "properties": { 19 | "family": "[parameters('osFamily')]" 20 | } 21 | }, 22 | { 23 | "name": "another os instance", 24 | "type": "Microsoft/OSInfo", 25 | "properties": { 26 | "family": "macOS" 27 | } 28 | }, 29 | { 30 | "name": "path", 31 | "type": "Microsoft.DSC.Debug/Echo", 32 | "properties": { 33 | "output": "[envvar('PATH')]" 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /dsc/examples/osinfo_parameters.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | parameters: 3 | osFamily: 4 | type: string 5 | # the use of `concat()` here is just an example of using an expression for a defaultValue 6 | defaultValue: "[concat('Win','dows')]" 7 | allowedValues: 8 | - Windows 9 | - Linux 10 | - macOS 11 | resources: 12 | - name: os 13 | type: Microsoft/OSInfo 14 | properties: 15 | family: "[parameters('osFamily')]" 16 | - name: another os instance 17 | type: Microsoft/OSInfo 18 | properties: 19 | family: macOS 20 | - name: path 21 | type: Microsoft.DSC.Debug/Echo 22 | properties: 23 | output: "[envvar('PATH')]" 24 | -------------------------------------------------------------------------------- /dsc/examples/osinfo_registry.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Simple example using two different resources and one of them twice. 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: os 5 | type: Microsoft/OSInfo 6 | properties: {} 7 | - name: windows product name 8 | type: Microsoft.Windows/Registry 9 | properties: 10 | keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion 11 | valueName: ProductName 12 | - name: system root 13 | type: Microsoft.Windows/Registry 14 | properties: 15 | keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion 16 | valueName: SystemRoot 17 | -------------------------------------------------------------------------------- /dsc/examples/powershell.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration mixing native app resources with classic PS resources 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | metadata: 4 | Microsoft.DSC: 5 | securityContext: elevated 6 | resources: 7 | - name: Use class PowerShell resources 8 | type: Microsoft.Windows/WindowsPowerShell 9 | properties: 10 | resources: 11 | - name: OpenSSH service 12 | type: PsDesiredStateConfiguration/Service 13 | properties: 14 | Name: sshd 15 | - name: Administrator 16 | type: PsDesiredStateConfiguration/User 17 | properties: 18 | UserName: administrator 19 | - name: current user registry 20 | type: Microsoft.Windows/Registry 21 | properties: 22 | keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion 23 | valueName: ProductName 24 | _exist: True 25 | -------------------------------------------------------------------------------- /dsc/examples/reference.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Simple example showing how to reference output from a resource to use in another 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: os 5 | type: Microsoft/OSInfo 6 | properties: {} 7 | - name: Echo 8 | type: Microsoft.DSC.Debug/Echo 9 | properties: 10 | output: "[concat('The OS is ', reference(resourceId('Microsoft/OSInfo','os')).family)]" 11 | dependsOn: 12 | - "[resourceId('Microsoft/OSInfo','os')]" 13 | -------------------------------------------------------------------------------- /dsc/examples/require_admin.yaml: -------------------------------------------------------------------------------- 1 | # example showing use of specific metadata to indicate this config requires admin to run 2 | # note that the resource doesn't require admin, but this will fail to even try to run the 3 | # config if the user is not root or elevated as administrator 4 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 5 | metadata: 6 | Microsoft.DSC: 7 | securityContext: elevated 8 | resources: 9 | - name: os 10 | type: Microsoft/OSInfo 11 | properties: {} 12 | -------------------------------------------------------------------------------- /dsc/examples/require_nonadmin.yaml: -------------------------------------------------------------------------------- 1 | # example showing use of specific metadata to indicate this config requires admin to run 2 | # this will fail to even try to run the config if the user is root or elevated as administrator 3 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 4 | metadata: 5 | Microsoft.DSC: 6 | securityContext: restricted 7 | resources: 8 | - name: os 9 | type: Microsoft/OSInfo 10 | properties: {} 11 | -------------------------------------------------------------------------------- /dsc/examples/secure_parameters.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | parameters: 3 | myString: 4 | type: secureString 5 | myObject: 6 | type: secureObject 7 | resources: 8 | - name: Echo 1 9 | type: Microsoft.DSC.Debug/Echo 10 | properties: 11 | output: "[parameters('myString')]" 12 | - name: Echo 2 13 | type: Microsoft.DSC.Debug/Echo 14 | properties: 15 | output: "[parameters('myObject').myProperty]" 16 | -------------------------------------------------------------------------------- /dsc/examples/secure_parameters.parameters.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | myString: mySecret 3 | myObject: 4 | myProperty: mySecretProperty 5 | -------------------------------------------------------------------------------- /dsc/examples/variables.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | parameters: 3 | myParameter: 4 | type: string 5 | # the use of `concat()` here is just an example of using an expression for a defaultValue 6 | defaultValue: "[concat('world','!')]" 7 | variables: 8 | myOutput: "[concat('Hello ', parameters('myParameter'))]" 9 | myObject: 10 | test: baz 11 | resources: 12 | - name: test 13 | type: Microsoft.DSC.Debug/Echo 14 | properties: 15 | output: "[concat('myOutput is: ', variables('myOutput'), ', myObject is: ', variables('myObject').test)]" 16 | -------------------------------------------------------------------------------- /dsc/examples/winget.dsc.yaml: -------------------------------------------------------------------------------- 1 | # The `Microsoft.Winget.DSC` resources needs to be installed: install-psresource Microsoft.Winget.DSC -Prerelease 2 | 3 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 4 | parameters: 5 | ensureCalc: 6 | type: string 7 | defaultValue: Present 8 | allowedValues: 9 | - Present 10 | - Absent 11 | resources: 12 | - name: Use class PowerShell resources 13 | type: Microsoft.DSC/PowerShell 14 | properties: 15 | resources: 16 | - name: PowerShell 7 Preview 17 | type: Microsoft.WinGet.DSC/WinGetPackage 18 | properties: 19 | Id: Microsoft.PowerShell.Preview 20 | - name: Calc from Windows Store 21 | type: Microsoft.WinGet.DSC/WinGetPackage 22 | properties: 23 | Id: "9WZDNCRFHVN5" 24 | Ensure: "[parameters('ensureCalc')]" 25 | -------------------------------------------------------------------------------- /dsc/examples/winps_script.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | metadata: 3 | Microsoft.DSC: 4 | securityContext: elevated 5 | resources: 6 | - type: Microsoft.Windows/WindowsPowerShell 7 | name: Run WinPS script 8 | properties: 9 | resources: 10 | - name: Run script 11 | type: PSDesiredStateConfiguration/Script 12 | properties: 13 | GetScript: | 14 | $text = @" 15 | get 16 | "@ 17 | # Returning result must be this type of hashtable 18 | @{Result=$text} 19 | TestScript: | 20 | # TestScript must return a boolean 21 | $true 22 | SetScript: | 23 | $text = @" 24 | set 25 | "@ 26 | -------------------------------------------------------------------------------- /dsc/tests/dsc.exist.tests.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | Describe '_exist tests' { 5 | It 'Resource supporting exist on set should receive _exist for: ' -TestCases @( 6 | @{ exist = $true } 7 | @{ exist = $false } 8 | ) { 9 | param($exist) 10 | 11 | $json = @" 12 | { 13 | "_exist": $exist 14 | } 15 | "@ 16 | $out = dsc resource set -r Test/Exist --input $json | ConvertFrom-Json 17 | $LASTEXITCODE | Should -Be 0 18 | 19 | $out.afterState._exist | Should -Be $exist 20 | if ($exist) { 21 | $out.afterState.state | Should -Be 'Present' 22 | } 23 | else { 24 | $out.afterState.state | Should -Be 'Absent' 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dsc/tests/dsc_assertion.tests.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | Describe 'Assertion resource tests' -Skip:(!$IsWindows) { 5 | It 'Example works for ' -TestCases @( 6 | @{ operation = 'get' } 7 | @{ operation = 'set' } 8 | @{ operation = 'test' } 9 | # TODO: Add export to test when https://github.com/PowerShell/DSC/issues/428 is fixed 10 | # @{ operation = 'export' } 11 | ) { 12 | param($operation) 13 | $jsonPath = Join-Path $PSScriptRoot '../examples/assertion.dsc.yaml' 14 | $out = dsc config $operation -f $jsonPath 2> "$TestDrive/trace.log" 15 | $LASTEXITCODE | Should -Be 2 16 | $out | Should -BeNullOrEmpty 17 | $log = Get-Content "$TestDrive/trace.log" -Raw 18 | $log | Should -Match '.*Assertion failed.*' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /dsc/tests/dsc_reference.tests.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | Describe 'Tests for config using reference function' { 5 | It 'Reference works for ' -TestCases @( 6 | @{ operation = 'get' }, 7 | @{ operation = 'test' } 8 | ) { 9 | param($operation) 10 | 11 | $out = dsc config $operation -f $PSScriptRoot/../examples/reference.dsc.yaml | ConvertFrom-Json 12 | $LASTEXITCODE | Should -Be 0 13 | $os = if ($IsWindows) { 14 | 'Windows' 15 | } 16 | elseif ($IsLinux) { 17 | 'Linux' 18 | } 19 | else { 20 | 'macOS' 21 | } 22 | 23 | $out.results[1].result.actualState.Output | Should -BeExactly "The OS is $os" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dsc_lib/src/configure/parameters.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | use serde_json::Value; 7 | use std::collections::HashMap; 8 | 9 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 10 | pub struct Input { 11 | pub parameters: HashMap, 12 | } 13 | 14 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 15 | #[serde(deny_unknown_fields, untagged)] 16 | pub enum SecureKind { 17 | #[serde(rename = "secureString")] 18 | SecureString(String), 19 | #[serde(rename = "secureObject")] 20 | SecureObject(Value), 21 | } 22 | -------------------------------------------------------------------------------- /dsc_lib/src/dscresources/include.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | pub struct Include { 9 | /// The path to the file to include. Relative paths are relative to the file containing the include 10 | /// and not allowed to reference parent directories. 11 | #[serde(rename = "configurationFile")] 12 | pub configuration_file: String, 13 | } 14 | -------------------------------------------------------------------------------- /dsc_lib/src/dscresources/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | pub mod command_resource; 5 | pub mod dscresource; 6 | pub mod invoke_result; 7 | pub mod resource_manifest; 8 | 9 | use super::dscerror; 10 | -------------------------------------------------------------------------------- /dsc_lib/src/extensions/discover.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use crate::dscresources::resource_manifest::ArgKind; 5 | use schemars::JsonSchema; 6 | use serde::{Deserialize, Serialize}; 7 | 8 | #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 9 | pub struct DiscoverMethod { 10 | /// The command to run to get the state of the resource. 11 | pub executable: String, 12 | /// The arguments to pass to the command to perform a Get. 13 | pub args: Option>, 14 | } 15 | 16 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 17 | pub struct DiscoverResult { 18 | /// The path to the resource manifest, must be absolute. 19 | #[serde(rename = "manifestPath")] 20 | pub manifest_path: String, 21 | } 22 | -------------------------------------------------------------------------------- /dsc_lib/src/extensions/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | pub mod discover; 5 | pub mod dscextension; 6 | pub mod extension_manifest; 7 | -------------------------------------------------------------------------------- /dscecho/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dscecho" 3 | version = "1.0.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | codegen-units = 1 # reduces binary size by ~2% 8 | debug = "full" # No one needs an undebuggable release binary 9 | lto = true # reduces binary size by ~14% 10 | opt-level = "s" # reduces binary size by ~25% 11 | panic = "abort" # reduces binary size by ~50% in combination with -Zbuild-std-features=panic_immediate_abort 12 | split-debuginfo = "packed" # generates a seperate *.dwp/*.dSYM so the binary can get stripped 13 | strip = "symbols" # See split-debuginfo - allows us to drop the size by ~65% 14 | 15 | [dependencies] 16 | clap = { version = "4.5", features = ["derive"] } 17 | rust-i18n = { version = "3.1" } 18 | schemars = { version = "0.8" } 19 | serde = { version = "1.0", features = ["derive"] } 20 | serde_json = { version = "1.0", features = ["preserve_order"] } 21 | -------------------------------------------------------------------------------- /dscecho/locales/en-us.toml: -------------------------------------------------------------------------------- 1 | _version = 1 2 | 3 | [main] 4 | invalidJson = "Error JSON does not match schema" 5 | noInput = "No input provided." 6 | -------------------------------------------------------------------------------- /dscecho/src/args.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use clap::Parser; 5 | 6 | #[derive(Debug, Parser)] 7 | #[clap(name = "dscecho", version = "1.0.0", about = "Debugging helper resource that echos the input.", long_about = None)] 8 | pub struct Args { 9 | #[clap(short, long, help = "The input to the echo command as JSON. If no input is provided the JSON schema for the input is returned.")] 10 | pub input: Option, 11 | } 12 | -------------------------------------------------------------------------------- /extensions/appx/appx-discover.ps1: -------------------------------------------------------------------------------- 1 | $packages = Get-AppxPackage 2 | foreach ($package in $packages) { 3 | $manifests = Get-ChildItem -Path "$($package.InstallLocation)\*" -File -Include '*.dsc.resource.json','*.dsc.resource.yaml','*.dsc.resource.yml' -ErrorAction Ignore 4 | foreach ($manifest in $manifests) { 5 | @{ manifestPath = $manifest.FullName } | ConvertTo-Json -Compress 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /extensions/appx/appx.dsc.extension.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Microsoft.Windows.Appx/Discover", 4 | "version": "0.1.0", 5 | "description": "Discovers DSC resources packaged as Appx packages.", 6 | "discover": { 7 | "executable": "powershell", 8 | "args": [ 9 | "-NoLogo", 10 | "-NonInteractive", 11 | "-ExecutionPolicy", 12 | "Bypass", 13 | "-NoProfile", 14 | "-Command", 15 | "./appx-discover.ps1" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /extensions/appx/appx.tests.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | Describe 'Tests for Appx resource discovery' -Skip:(!$IsWindows){ 5 | It 'Should find DSC appx resources' { 6 | $out = dsc resource list | ConvertFrom-Json 7 | $LASTEXITCODE | Should -Be 0 8 | $found = $false 9 | foreach ($resource in $out) { 10 | if ($resource.directory.StartsWith("$env:ProgramFiles\WindowsApps\Microsoft.DesiredStateConfiguration-Private")) { 11 | $found = $true 12 | break 13 | } 14 | } 15 | $found | Should -Be $true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /extensions/appx/copy_files.txt: -------------------------------------------------------------------------------- 1 | appx-discover.ps1 2 | appx.dsc.extension.json 3 | -------------------------------------------------------------------------------- /extensions/test/discover/discover.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | [CmdletBinding()] 5 | param( 6 | [Parameter()] 7 | [switch]$RelativePath 8 | ) 9 | 10 | Get-ChildItem -Path $PSScriptRoot/resources/*.json | ForEach-Object { 11 | $resource = [pscustomobject]@{ 12 | manifestPath = if ($RelativePath) { 13 | Resolve-Path -Path $_.FullName -Relative 14 | } else { 15 | $_.FullName 16 | } 17 | } 18 | $resource | ConvertTo-Json -Compress 19 | } 20 | -------------------------------------------------------------------------------- /extensions/test/discover/testDiscover.dsc.extension.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/Discover", 4 | "version": "0.1.0", 5 | "description": "Test discover resource, this is a really long description to test that the table can be rendered without truncating the description text from this extension.", 6 | "discover": { 7 | "executable": "pwsh", 8 | "args": [ 9 | "-NoLogo", 10 | "-NonInteractive", 11 | "-NoProfile", 12 | "-Command", 13 | "./discover.ps1" 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /osinfo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "osinfo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | codegen-units = 1 # reduces binary size by ~2% 8 | debug = "full" # No one needs an undebuggable release binary 9 | lto = true # reduces binary size by ~14% 10 | opt-level = "s" # reduces binary size by ~25% 11 | panic = "abort" # reduces binary size by ~50% in combination with -Zbuild-std-features=panic_immediate_abort 12 | split-debuginfo = "packed" # generates a seperate *.dwp/*.dSYM so the binary can get stripped 13 | strip = "symbols" # See split-debuginfo - allows us to drop the size by ~65% 14 | 15 | [dependencies] 16 | os_info = { version = "3.11" } 17 | serde = { version = "1.0", features = ["derive"] } 18 | serde_json = { version = "1.0", features = ["preserve_order"] } 19 | -------------------------------------------------------------------------------- /osinfo/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | mod config; 5 | 6 | fn main() { 7 | let json = serde_json::to_string(&config::OsInfo::new()).unwrap(); 8 | println!("{json}"); 9 | } 10 | -------------------------------------------------------------------------------- /packaging/assets/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/Square150x150Logo.png -------------------------------------------------------------------------------- /packaging/assets/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/Square44x44Logo.png -------------------------------------------------------------------------------- /packaging/assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /packaging/assets/Square44x44Logo.targetsize-48_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/Square44x44Logo.targetsize-48_altform-unplated.png -------------------------------------------------------------------------------- /packaging/assets/Square64x64Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/Square64x64Logo.png -------------------------------------------------------------------------------- /packaging/assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerShell/DSC/cd13485cf0314125be0811b2b6758f3e5bf939f0/packaging/assets/StoreLogo.png -------------------------------------------------------------------------------- /pal/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | 3 | -------------------------------------------------------------------------------- /pal/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | [package] 4 | name = "pal" 5 | version = "0.1.0" 6 | edition = "2021" 7 | 8 | [profile.release] 9 | strip = true 10 | # optimize for size 11 | opt-level = 2 12 | # enable link time optimization to remove dead code 13 | lto = true 14 | 15 | [build-dependencies] 16 | cc = "1.1" 17 | -------------------------------------------------------------------------------- /pal/ext-ms-win-cng-rng-l1-1-0.def: -------------------------------------------------------------------------------- 1 | LIBRARY ext-ms-win-cng-rng-l1-1-0 2 | 3 | EXPORTS 4 | ProcessPrng 5 | -------------------------------------------------------------------------------- /pal/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | //! This crate provides a set of types that abstract over OS-specific platform 5 | //! primitives. It is focused on IO- and wait-related functionality: events, 6 | //! timers, and polling. 7 | //! 8 | //! As a convenience, it also exports some OS-specific functionality and some 9 | //! general library functionality. 10 | 11 | #[cfg(windows)] 12 | pub mod windows; 13 | 14 | #[cfg(windows)] 15 | use windows as sys; 16 | 17 | /// Writes cryptographically random bytes to `data` using the system RNG. Panics 18 | /// on error, since the system RNG should always be available. 19 | pub fn random(data: &mut [u8]) { 20 | unsafe { sys::getrandom(data.as_mut_ptr(), data.len()) } 21 | } 22 | -------------------------------------------------------------------------------- /pal/src/windows.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | //#[link(name = "ext-ms-win-cng-rng-l1-1-0")] 5 | extern "C" { 6 | fn ProcessPrng(data: *mut u8, len: usize) -> u32; 7 | } 8 | 9 | /// # Safety 10 | /// 11 | /// This function is unsafe because it dereferences a raw pointer. 12 | /// 13 | /// # Panics 14 | /// 15 | /// Will panic if the api returns 0 16 | pub unsafe fn getrandom(data: *mut u8, len: usize) { 17 | assert!((ProcessPrng(data, len) != 0), "ProcessPrng failed"); 18 | } 19 | -------------------------------------------------------------------------------- /powershell-adapter/Tests/PSTestModule/1.0.0/DscResources/TestPSRepository/TestPSRepository.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0.0"),FriendlyName("TestPSRepository")] 2 | class TestPSRepository : OMI_BaseResource 3 | { 4 | [Key] String Name; 5 | [Write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 6 | [Write] String SourceLocation; 7 | [Write] String ScriptSourceLocation; 8 | [Write] String PublishLocation; 9 | [Write] String ScriptPublishLocation; 10 | [Write, ValueMap{"Trusted","Untrusted"}, Values{"Trusted","Untrusted"}] String InstallationPolicy; 11 | [Write] String PackageManagementProvider; 12 | [Read] Boolean Trusted; 13 | [Read] Boolean Registered; 14 | }; 15 | -------------------------------------------------------------------------------- /powershell-adapter/Tests/class_ps_resources.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 5 | resources: 6 | - name: Working with classic DSC resources 7 | type: Microsoft.DSC/PowerShell 8 | properties: 9 | resources: 10 | - name: Class-resource Info 11 | type: TestClassResource/TestClassResource 12 | properties: 13 | Name: TestClassResource1 14 | Prop1: ValueForProp1 15 | EnumProp: Expected 16 | -------------------------------------------------------------------------------- /powershell-adapter/Tests/winps_reference_resource.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 5 | resources: 6 | - name: Copy contents from one file to another 7 | type: Microsoft.Windows/WindowsPowerShell 8 | properties: 9 | resources: 10 | - name: From 11 | type: PSDesiredStateConfiguration/File 12 | properties: 13 | DestinationPath: $env:TEMP\testFrom.txt 14 | - name: To 15 | type: PSDesiredStateConfiguration/File 16 | properties: 17 | DestinationPath: $env:TEMP\testTo.txt 18 | Contents: "[reference(resourceId('PSDesiredStateConfiguration/File','From')).contents)]" 19 | output: Contents 20 | dependsOn: 21 | - "[resourceId('PSDesiredStateConfiguration/File','From')]" 22 | 23 | -------------------------------------------------------------------------------- /powershell-adapter/Tests/winps_resource.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 5 | resources: 6 | - name: Get info from classic DSC resources 7 | type: Microsoft.Windows/WindowsPowerShell 8 | properties: 9 | resources: 10 | - name: File 11 | type: PSDesiredStateConfiguration/File 12 | properties: 13 | DestinationPath: c:\test.txt 14 | Contents: 'Hello, World!' 15 | -------------------------------------------------------------------------------- /powershell-adapter/copy_files.txt: -------------------------------------------------------------------------------- 1 | ./psDscAdapter/powershell.resource.ps1 2 | ./psDscAdapter/psDscAdapter.psd1 3 | ./psDscAdapter/psDscAdapter.psm1 4 | ./psDscAdapter/win_psDscAdapter.psd1 5 | ./psDscAdapter/win_psDscAdapter.psm1 -------------------------------------------------------------------------------- /process/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "process" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | sysinfo = "0.35" 8 | serde = { version = "1.0", features = ["derive"] } 9 | serde_json = { version = "1.0", features = ["preserve_order"] } 10 | -------------------------------------------------------------------------------- /process/ExportTest.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration mixing native app resources with classic PS resources 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: Processes 5 | type: Microsoft/Process 6 | properties: 7 | pid: 0 8 | -------------------------------------------------------------------------------- /process/src/process_info.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use serde::Serialize; 5 | 6 | #[derive(Debug, Clone, PartialEq, Serialize)] 7 | pub struct ProcessInfo { 8 | pub pid: u32, 9 | pub name: String, 10 | pub cmdline: String 11 | } 12 | 13 | impl ProcessInfo { 14 | pub fn new() -> Self { 15 | 16 | Self { 17 | pid: 0, 18 | name: String::new(), 19 | cmdline: String::new(), 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /reboot_pending/copy_files.txt: -------------------------------------------------------------------------------- 1 | reboot_pending.resource.ps1 2 | -------------------------------------------------------------------------------- /reboot_pending/reboot_pending.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "description": "Returns info about pending reboot.", 4 | "type": "Microsoft.Windows/RebootPending", 5 | "version": "0.1.0", 6 | "get": { 7 | "executable": "powershell", 8 | "args": [ 9 | "-NoLogo", 10 | "-NonInteractive", 11 | "-NoProfile", 12 | "-Command", 13 | "reboot_pending.resource.ps1" 14 | ] 15 | }, 16 | "exitCodes": { 17 | "0": "Success", 18 | "1": "Error" 19 | }, 20 | "schema": { 21 | "embedded": { 22 | "$schema": "https://json-schema.org/draft/2020-12/schema", 23 | "type": [ 24 | "object", 25 | "null" 26 | ], 27 | "properties": { 28 | "rebootPending": { 29 | "type": "boolean", 30 | "readOnly": true 31 | } 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /reboot_pending/tests/reboot_pending.dsc.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 2 | resources: 3 | - name: Pending reboot status 4 | type: Microsoft.Windows/RebootPending 5 | -------------------------------------------------------------------------------- /reboot_pending/tests/reboot_pending.tests.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | Describe 'reboot_pending resource tests' { 5 | It 'should get reboot_pending' -Skip:(!$IsWindows) { 6 | $out = dsc resource get -r Microsoft.Windows/RebootPending | ConvertFrom-Json 7 | $LASTEXITCODE | Should -Be 0 8 | $out.actualState.rebootPending | Should -Not -BeNullOrEmpty 9 | } 10 | 11 | It 'reboot_pending works in a config' -Skip:(!$IsWindows) { 12 | $ConfigPath = Resolve-Path "$PSScriptRoot/reboot_pending.dsc.yaml" 13 | $out = dsc config get --file $ConfigPath | ConvertFrom-Json 14 | $LASTEXITCODE | Should -Be 0 15 | $out.results.result.actualState.rebootPending | Should -Not -BeNullOrEmpty 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /registry/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | fn main() { 5 | // Prevent this build script from rerunning unnecessarily. 6 | println!("cargo:rerun-if-changed=build.rs"); 7 | static_vcruntime::metabuild(); 8 | } 9 | -------------------------------------------------------------------------------- /resources/apt/copy_files.txt: -------------------------------------------------------------------------------- 1 | apt.dsc.resource.sh 2 | -------------------------------------------------------------------------------- /resources/apt/test/assets/apt_install_rolldice.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: assertions 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: os_check 10 | type: Microsoft/OSInfo 11 | properties: 12 | family: Linux 13 | - name: apt_rolldice 14 | type: DSC.PackageManagement/Apt 15 | properties: 16 | packageName: rolldice 17 | _exist: true 18 | dependsOn: 19 | - "[resourceId('Microsoft.DSC/Assertion','assertions')]" 20 | -------------------------------------------------------------------------------- /resources/apt/test/assets/apt_uninstall_rolldice.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: assertions 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: os_check 10 | type: Microsoft/OSInfo 11 | properties: 12 | family: Linux 13 | - name: apt_rolldice 14 | type: DSC.PackageManagement/Apt 15 | properties: 16 | packageName: rolldice 17 | _exist: false 18 | dependsOn: 19 | - "[resourceId('Microsoft.DSC/Assertion','assertions')]" 20 | -------------------------------------------------------------------------------- /resources/apt/test/assets/apt_wget.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example to see if PowerShell 7 is installed, install it, or get all installed packages 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: assertions 5 | type: Microsoft.DSC/Assertion 6 | properties: 7 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 8 | resources: 9 | - name: os_check 10 | type: Microsoft/OSInfo 11 | properties: 12 | family: Linux 13 | - name: apt_wget 14 | type: DSC.PackageManagement/Apt 15 | properties: 16 | packageName: wget 17 | _exist: true 18 | dependsOn: 19 | - "[resourceId('Microsoft.DSC/Assertion','assertions')]" 20 | -------------------------------------------------------------------------------- /resources/brew/copy_files.txt: -------------------------------------------------------------------------------- 1 | brew.dsc.resource.sh 2 | -------------------------------------------------------------------------------- /runcommandonset/locales/en-us.toml: -------------------------------------------------------------------------------- 1 | _version = 1 2 | 3 | [main] 4 | emptyStdin = "Input from STDIN is empty" 5 | invalidTraceLevel = "Defaulting to Info, invalid trace level defined in DSC_TRACE_LEVEL env var" 6 | invalidUtf8 = "Invalid UTF-8 sequence" 7 | notIdempotent = "This resource is not idempotent" 8 | readStdin = "Reading input from STDIN" 9 | 10 | [runcommand] 11 | invalidJson = "Failed to serialize to JSON" 12 | 13 | [utils] 14 | executableRequired = "Executable is required when input is not provided via stdin" 15 | failedToExecute = "Failed to execute" 16 | failedOpenStderr = "Failed to open stderr for" 17 | failedOpenStdout = "Failed to open stdout for" 18 | failedReadStderr = "Failed to read stderr for" 19 | failedReadStdout = "Failed to read stdout for" 20 | failedWait = "Failed to wait for" 21 | invalidInput = "Input is not valid" 22 | unableToTrace = "Unable to set global default tracing subscriber. Tracing is disabled." 23 | -------------------------------------------------------------------------------- /schemas/2023/08/bundled/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command.", 6 | "type": "object", 7 | "required": [ 8 | "actualState" 9 | ], 10 | "properties": { 11 | "actualState": { 12 | "title": "Actual state", 13 | "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", 14 | "type": "object" 15 | } 16 | }, 17 | "$defs": {} 18 | } 19 | -------------------------------------------------------------------------------- /schemas/2023/08/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/08/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/commandArgs.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/commandArgs.json", 4 | "title": "Executable Command Arguments", 5 | "description": "The list of arguments to pass to the command.", 6 | "type": "array", 7 | "items": { 8 | "type": "string" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC Resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "securestring", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureobject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json", 4 | "title": "DSC Resource fully qualified type name", 5 | "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/08/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "default": "state", 11 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2023/08/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command.", 6 | "type": "object", 7 | "required": [ 8 | "actualState" 9 | ], 10 | "properties": { 11 | "actualState": { 12 | "title": "Actual state", 13 | "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", 14 | "type": "object" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2023/08/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/08/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/08/resource/manifest.export.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.export.json", 4 | "title": "Get Method", 5 | "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", 6 | "type": "object", 7 | "required": [ 8 | "executable" 9 | ], 10 | "properties": { 11 | "executable": { 12 | "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" 13 | }, 14 | "args": { 15 | "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandArgs.json" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /schemas/2023/08/resource/properties/ensure.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/properties/ensure.json", 4 | "title": "Ensure Existence", 5 | "description": "Indicates whether the DSC Resource instance should exist.", 6 | "type": "string", 7 | "enum": [ 8 | "Absent", 9 | "Present" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/08/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/08/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/08/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/10/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/10/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/commandArgs.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/commandArgs.json", 4 | "title": "Executable Command Arguments", 5 | "description": "The list of arguments to pass to the command.", 6 | "type": "array", 7 | "items": { 8 | "type": "string" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC Resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "securestring", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureobject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/resourceType.json", 4 | "title": "DSC Resource fully qualified type name", 5 | "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2023/10/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "default": "state", 11 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2023/10/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/get.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/get.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2023/10/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/10/outputs/resource/set.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/resource/set.json", 4 | "title": "dsc resource set result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/set.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/set.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2023/10/outputs/resource/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/resource/test.json", 4 | "title": "dsc resource test result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/test.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/outputs/resource/test.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2023/10/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2023/10/resource/manifest.export.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.export.json", 4 | "title": "Get Method", 5 | "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", 6 | "type": "object", 7 | "required": [ 8 | "executable" 9 | ], 10 | "properties": { 11 | "executable": { 12 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/definitions/commandExecutable.json" 13 | }, 14 | "args": { 15 | "$ref": "/PowerShell/DSC/main/schemas/2023/10/definitions/commandArgs.json" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /schemas/2023/10/resource/properties/exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/properties/exist.json", 4 | "title": "Instance should exist", 5 | "description": "Indicates whether the DSC Resource instance should exist.", 6 | "type": "boolean", 7 | "default": true, 8 | "enum": [ 9 | false, 10 | true 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2023/10/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/10/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2023/10/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2024/04/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/bundled/outputs/resource/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/bundled/outputs/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC Resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "secureString", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureObject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/resourceKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/resourceKind.json", 4 | "title": "Resource kind", 5 | "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", 6 | "type": "string", 7 | "enum": [ 8 | "Resource", 9 | "Adapter", 10 | "Group", 11 | "Import" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/resourceType.json", 4 | "title": "DSC Resource fully qualified type name", 5 | "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "default": "state", 11 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/duration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/duration.json", 4 | "title": "Duration", 5 | "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", 6 | "type": "string", 7 | "format": "duration" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/endDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/endDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/executionType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/executionType.json", 4 | "title": "Execution type", 5 | "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", 6 | "type": "string", 7 | "enum": [ 8 | "Actual", 9 | "WhatIf" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/operation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/operation.json", 4 | "title": "Operation", 5 | "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", 6 | "type": "string", 7 | "enum": [ 8 | "Get", 9 | "Set", 10 | "Test", 11 | "Export" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/securityContext.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/securityContext.json", 4 | "title": "Security context", 5 | "description": "Defines the security context that DSC was run under. If the value for this metadata property is `Elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `Restricted`, DSC was run as a normal user or account in a non-elevated session.", 6 | "type": "string", 7 | "enum": [ 8 | "Current", 9 | "Elevated", 10 | "Restricted" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/startDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/startDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/2024/04/metadata/Microsoft.DSC/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/version.json", 4 | "title": "DSC Version", 5 | "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", 6 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/definitions/semver.json" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2024/04/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/get.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/get.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2024/04/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2024/04/outputs/resource/set.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/set.json", 4 | "title": "dsc resource set result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/set.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/set.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2024/04/outputs/resource/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/test.json", 4 | "title": "dsc resource test result", 5 | "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/test.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/2024/04/outputs/resource/test.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/2024/04/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/schema.json", 4 | "title": "DSC Resource schema result", 5 | "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/2024/04/resource/properties/exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/exist.json", 4 | "title": "Instance should exist", 5 | "description": "Indicates whether the DSC Resource instance should exist.", 6 | "type": "boolean", 7 | "default": true, 8 | "enum": [ 9 | false, 10 | true 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/2024/04/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2024/04/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/2024/04/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/examples/configuration_document/example.dsc.config.yaml: -------------------------------------------------------------------------------- 1 | # For testing outside of the repository, set the schema in the yaml server directive to: 2 | # https://raw.githubusercontent.com/PowerShell/DSC/main/v3/resource/manifest.json 3 | # 4 | # Hover on the keys to see the documentation. Try changing values and adding new settings. 5 | $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json 6 | # Try adding the variables, metadata, and parameters properties, 7 | # then use IntelliSense to define a few entries. 8 | 9 | resources: 10 | - type: example/resource 11 | name: My Example 12 | properties: 13 | foo: bar 14 | # Define a new resource instance 15 | -------------------------------------------------------------------------------- /schemas/examples/resource_manifest/foo.dsc.resource.yaml: -------------------------------------------------------------------------------- 1 | # For testing outside of the repository, set the schema in the yaml server directive to: 2 | # https://raw.githubusercontent.com/PowerShell/DSC/main/v3/resource/manifest.json 3 | # 4 | # Hover on the keys to see the documentation. Try changing values and adding new settings. 5 | $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json 6 | type: Example/Foo 7 | version: 0.1.0 8 | description: An example resource to manage the foo application. 9 | tags: 10 | - foo 11 | get: 12 | executable: foo 13 | args: 14 | - get 15 | input: stdin 16 | set: 17 | executable: foo 18 | input: stdin 19 | preTest: false 20 | return: state 21 | -------------------------------------------------------------------------------- /schemas/src/definitions/commandExecutable.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///definitions/commandExecutable.yaml 4 | 5 | title: Executable Command Name 6 | description: >- 7 | The name of the command to run. 8 | type: string 9 | -------------------------------------------------------------------------------- /schemas/src/definitions/hadErrors.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///definitions/hadErrors.yaml 4 | 5 | title: Had Errors 6 | description: >- 7 | Indicates whether any of the DSC resources returned a non-zero exit code. 8 | type: boolean -------------------------------------------------------------------------------- /schemas/src/definitions/messages.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///definitions/messages.yaml 4 | 5 | title: Messages 6 | description: >- 7 | A list of structured messages emitted by the DSC resources during an 8 | operation. 9 | 10 | type: array 11 | items: 12 | $ref: ///definitions/message.yaml 13 | -------------------------------------------------------------------------------- /schemas/src/definitions/parameters/validValueTypes.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///definitions/parameters/validValueTypes.yaml 4 | 5 | $comment: | 6 | This schema fragment makes it a little easier to compose the valid properties 7 | for DSC configuration document parameters. As-written, values must be one of 8 | those on this list - the schema definition for dataType excludes `null` and 9 | numbers with fractional parts, like `3.5`. 10 | 11 | type: 12 | - string 13 | - integer 14 | - object 15 | - array 16 | - boolean -------------------------------------------------------------------------------- /schemas/src/definitions/returnKind.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///definitions/returnKind.yaml 4 | 5 | title: Return Kind 6 | type: string 7 | enum: 8 | - state 9 | - stateAndDiff 10 | 11 | $comment: |- 12 | While the enumeration for return kind is the same for the `set` and `test` 13 | method, the way it changes the behavior of the command isn't. The description 14 | keyword isn't included here because the respective schemas for those methods 15 | document the behavior themselves. 16 | -------------------------------------------------------------------------------- /schemas/src/metadata/Microsoft.DSC/context.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///metadata/Microsoft.DSC/context.yaml 4 | # Documentation 5 | title: Operation context 6 | description: >- 7 | Defines whether the operation was for a configuration or a resource. If the value for this 8 | metadata property is `configuration`, DSC was run through the `dsc config` command. If the value 9 | is `resource`, DSC was run with the `dsc resource` command. 10 | 11 | markdownDescription: |- 12 | Defines whether the operation was for a configuration or a resource. If the value for this 13 | metadata property is `configuration`, DSC was run through the `dsc config` command. If the value 14 | is `resource`, DSC was run with the `dsc resource` command. 15 | # Definition 16 | type: string 17 | enum: 18 | - resource 19 | - configuration 20 | -------------------------------------------------------------------------------- /schemas/src/metadata/Microsoft.DSC/endDatetime.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///metadata/Microsoft.DSC/endDatetime.yaml 4 | # Documentation 5 | title: Start date and time 6 | description: >- 7 | Defines the end date and time for the DSC operation as a timestamp following the format defined 8 | in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`. 9 | markdownDescription: |- 10 | Defines the end date and time for the DSC operation as a timestamp following the format defined 11 | in [RFC3339, section 5.6 (see `date-time`)][01]. 12 | 13 | For example: `2024-04-14T08:49:51.395686600-07:00` 14 | 15 | [01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 16 | # Definition 17 | type: string 18 | format: date-time 19 | -------------------------------------------------------------------------------- /schemas/src/metadata/Microsoft.DSC/operation.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///metadata/Microsoft.DSC/operation.yaml 4 | # Documentation 5 | title: Operation 6 | description: >- 7 | Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or 8 | `Export`. 9 | markdownDescription: |- 10 | Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or 11 | `Export`. 12 | # Definition 13 | type: string 14 | enum: 15 | - get 16 | - set 17 | - test 18 | - export 19 | -------------------------------------------------------------------------------- /schemas/src/metadata/Microsoft.DSC/startDatetime.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///metadata/Microsoft.DSC/startDatetime.yaml 4 | # Documentation 5 | title: Start date and time 6 | description: >- 7 | Defines the start date and time for the DSC operation as a timestamp following the format defined 8 | in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`. 9 | markdownDescription: |- 10 | Defines the start date and time for the DSC operation as a timestamp following the format defined 11 | in [RFC3339, section 5.6 (see `date-time`)][01]. 12 | 13 | For example: `2024-04-14T08:49:51.395686600-07:00` 14 | 15 | [01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 16 | # Definition 17 | type: string 18 | format: date-time 19 | -------------------------------------------------------------------------------- /schemas/src/metadata/Microsoft.DSC/version.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///metadata/Microsoft.DSC/version.yaml 4 | # Documentation 5 | title: DSC Version 6 | description: >- 7 | Defines the version of DSC that ran the command. This value is always the semantic version of the 8 | DSC command, like `3.0.0-preview.7`. 9 | markdownDescription: |- 10 | Defines the version of DSC that ran the command. This value is always the semantic version of the 11 | DSC command, like `3.0.0-preview.7`. 12 | # Definition 13 | $ref: ///definitions/semver.yaml 14 | -------------------------------------------------------------------------------- /schemas/src/outputs/resource/get.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///outputs/resource/get.yaml 4 | 5 | title: dsc resource get result 6 | description: >- 7 | Describes the return data for a DSC resource instance from the 8 | `dsc resource get` command. The return data is either a single object that 9 | describes the actual state of a non-nested instance or an array of objects 10 | that describe the actual state of the nested instances for a group or adapter 11 | resource. 12 | 13 | anyOf: 14 | - $ref: ///outputs/resource/get.simple.yaml 15 | - type: array 16 | items: 17 | $ref: ///outputs/resource/get.full.yaml 18 | -------------------------------------------------------------------------------- /schemas/src/outputs/resource/schema.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///outputs/resource/schema.yaml 4 | 5 | title: DSC resource schema result 6 | description: >- 7 | Describes the return data for a DSC resource from the `dsc resource schema` 8 | command. This command always returns the DSC resource's JSON schema document. 9 | 10 | type: object 11 | -------------------------------------------------------------------------------- /schemas/src/outputs/resource/set.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///outputs/resource/set.yaml 4 | 5 | title: dsc resource set result 6 | description: >- 7 | Describes the return data for a DSC resource instance from the 8 | `dsc resource set` command. The return data is either a single object that 9 | describes the enforced state of a non-nested instance or an array of objects 10 | that describe the enforced state of the nested instances for a group or 11 | adapter resource. 12 | 13 | anyOf: 14 | - $ref: ///outputs/resource/set.simple.yaml 15 | - type: array 16 | items: 17 | $ref: ///outputs/resource/set.full.yaml 18 | -------------------------------------------------------------------------------- /schemas/src/outputs/resource/test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///outputs/resource/test.yaml 4 | 5 | title: dsc resource test result 6 | description: >- 7 | Describes the return data for a DSC resource instance from the 8 | `dsc resource get` command. The return data is either a single object that 9 | describes the tested state of a non-nested instance or an array of objects 10 | that describe the tested state of the nested instances for a group or adapter 11 | resource. 12 | 13 | anyOf: 14 | - $ref: ///outputs/resource/test.simple.yaml 15 | - type: array 16 | items: 17 | $ref: ///outputs/resource/test.full.yaml -------------------------------------------------------------------------------- /schemas/src/outputs/schema.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///outputs/schema.yaml 4 | 5 | title: DSC resource schema result 6 | description: >- 7 | Describes the return data for a DSC resource from the `dsc schema` 8 | command. This command always returns a JSON schema document. 9 | 10 | type: object 11 | -------------------------------------------------------------------------------- /schemas/src/resource/properties/inDesiredState.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///resource/properties/inDesiredState.yaml 4 | 5 | title: Instance is in the Desired State 6 | description: >- 7 | Indicates whether the instance is in the desired state. This property is only returned by the 8 | `test` method. 9 | 10 | type: 11 | - boolean 12 | - 'null' 13 | readOnly: true 14 | 15 | # VS Code only 16 | markdownDescription: | 17 | *** 18 | [_Online Documentation_][01] 19 | *** 20 | 21 | Indicates whether the instance is in the desired state. This property is only returned by the 22 | `test` method. 23 | 24 | [01]: /reference/schemas/resource/properties/indesiredstate? 25 | -------------------------------------------------------------------------------- /schemas/src/resource/properties/rebootRequested.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///resource/properties/rebootRequested.yaml 4 | 5 | title: Reboot Requested 6 | description: >- 7 | Indicates that the set operation requires a reboot before it's fully complete. 8 | 9 | type: 10 | - boolean 11 | - 'null' 12 | readOnly: true 13 | 14 | # VS Code only 15 | markdownDescription: | 16 | *** 17 | [_Online Documentation_][01] 18 | *** 19 | 20 | Indicates that the set operation requires a reboot before it's fully complete. 21 | 22 | [01]: /reference/schemas/resource/properties/rebootrequested? 23 | -------------------------------------------------------------------------------- /schemas/src/resource/stdout/delete.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema 2 | $schema: https://json-schema.org/draft/2020-12/schema 3 | $id: ///resource/stdout/delete.yaml 4 | 5 | title: Delete resource operation stdout 6 | description: >- 7 | DSC does not expect the **Delete** operation for a resource to return any JSON to stdout. 8 | markdownDescription: | # VS Code only 9 | *** 10 | [_Online Documentation_][00] 11 | *** 12 | 13 | DSC does not expect the **Delete** operation for a resource to return any JSON to stdout. 14 | 15 | [00]: /reference/schemas/resource/stdout/delete? 16 | 17 | type: 'null' -------------------------------------------------------------------------------- /schemas/v3.0.0/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/bundled/outputs/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "secureString", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureObject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/resourceCapabilities.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceCapabilities.json", 4 | "title": "Resource capabilities", 5 | "description": "Define the operations you can invoke for a resource and how the resource behaves when invoked.", 6 | "type": "array", 7 | "items": { 8 | "type": "string", 9 | "enum": [ 10 | "get", 11 | "set", 12 | "setHandlesExist", 13 | "whatIf", 14 | "test", 15 | "delete", 16 | "export", 17 | "resolve" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/resourceKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", 4 | "title": "Resource kind", 5 | "description": "Defines whether the resource is a normal DSC resource, a group resource, or an adapter resource. This property is only required for group resources.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "adapter", 10 | "group", 11 | "importer" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", 4 | "title": "DSC resource fully qualified type name", 5 | "description": "The namespaced name of the DSC resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/context.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", 4 | "title": "Operation context", 5 | "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "configuration" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/duration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", 4 | "title": "Duration", 5 | "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", 6 | "type": "string", 7 | "format": "duration" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", 4 | "title": "Execution type", 5 | "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", 6 | "type": "string", 7 | "enum": [ 8 | "actual", 9 | "whatIf" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/operation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", 4 | "title": "Operation", 5 | "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", 6 | "type": "string", 7 | "enum": [ 8 | "get", 9 | "set", 10 | "test", 11 | "export" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", 4 | "title": "Security context", 5 | "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", 6 | "type": "string", 7 | "enum": [ 8 | "current", 9 | "elevated", 10 | "restricted" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0.0/metadata/Microsoft.DSC/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", 4 | "title": "DSC Version", 5 | "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", 6 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0.0/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/outputs/resource/set.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", 4 | "title": "dsc resource set result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0.0/outputs/resource/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", 4 | "title": "dsc resource test result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0.0/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/properties/exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json", 4 | "title": "Instance should exist", 5 | "description": "Indicates whether the DSC resource instance should exist.", 6 | "type": "boolean", 7 | "default": true, 8 | "enum": [ 9 | false, 10 | true 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC resource should exist. If other components exist, the DSC resource is out of the desired state. When enforcing desired state, the DSC resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/stdout/delete.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/stdout/delete.json", 4 | "title": "Delete resource operation stdout", 5 | "description": "DSC does not expect the **Delete** operation for a resource to return any JSON to stdout.", 6 | "type": "null" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/stdout/export.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/stdout/export.json", 4 | "title": "Export resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects every JSON Line emitted to stdout for the **Export** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/stdout/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/stdout/get.json", 4 | "title": "Get resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects the JSON Line emitted to stdout for the **Get** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/stdout/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/stdout/schema.json", 4 | "title": "Schema resource command stdout", 5 | "description": "Represents the JSON Schema that validates instances of the resource. DSC expects a resource that defines the `schema.command` field in its resource manifest to return this value for that command.", 6 | "type": "object", 7 | "required": [ 8 | "$schema", 9 | "type", 10 | "properties" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0.0/resource/stdout/validate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/stdout/validate.json", 4 | "title": "Validate resource operation stdout", 5 | "description": "Defines the JSON DSC expects a resource to emit to stdout for the **Validate** operation.", 6 | "type": "object", 7 | "required": [ 8 | "valid" 9 | ], 10 | "properties": { 11 | "valid": { 12 | "title": "Instance validity", 13 | "description": "Indicates whether the instance is valid for the resource." 14 | }, 15 | "reason": { 16 | "title": "Reason instance is invalid", 17 | "description": "Describes how and why the instance is invalid for the resource." 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /schemas/v3.0/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/bundled/outputs/resource/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/bundled/outputs/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "secureString", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureObject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/resourceCapabilities.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceCapabilities.json", 4 | "title": "Resource capabilities", 5 | "description": "Define the operations you can invoke for a resource and how the resource behaves when invoked.", 6 | "type": "array", 7 | "items": { 8 | "type": "string", 9 | "enum": [ 10 | "get", 11 | "set", 12 | "setHandlesExist", 13 | "whatIf", 14 | "test", 15 | "delete", 16 | "export", 17 | "resolve" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/resourceKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", 4 | "title": "Resource kind", 5 | "description": "Defines whether the resource is a normal DSC resource, a group resource, or an adapter resource. This property is only required for group resources.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "adapter", 10 | "group", 11 | "importer" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", 4 | "title": "DSC resource fully qualified type name", 5 | "description": "The namespaced name of the DSC resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/context.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", 4 | "title": "Operation context", 5 | "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "configuration" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/duration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", 4 | "title": "Duration", 5 | "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", 6 | "type": "string", 7 | "format": "duration" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/executionType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", 4 | "title": "Execution type", 5 | "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", 6 | "type": "string", 7 | "enum": [ 8 | "actual", 9 | "whatIf" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/operation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", 4 | "title": "Operation", 5 | "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", 6 | "type": "string", 7 | "enum": [ 8 | "get", 9 | "set", 10 | "test", 11 | "export" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/securityContext.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", 4 | "title": "Security context", 5 | "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", 6 | "type": "string", 7 | "enum": [ 8 | "current", 9 | "elevated", 10 | "restricted" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3.0/metadata/Microsoft.DSC/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", 4 | "title": "DSC Version", 5 | "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", 6 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/outputs/resource/set.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", 4 | "title": "dsc resource set result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0/outputs/resource/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", 4 | "title": "dsc resource test result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3.0/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/properties/exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json", 4 | "title": "Instance should exist", 5 | "description": "Indicates whether the DSC resource instance should exist.", 6 | "type": "boolean", 7 | "default": true, 8 | "enum": [ 9 | false, 10 | true 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC resource should exist. If other components exist, the DSC resource is out of the desired state. When enforcing desired state, the DSC resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/stdout/delete.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/stdout/delete.json", 4 | "title": "Delete resource operation stdout", 5 | "description": "DSC does not expect the **Delete** operation for a resource to return any JSON to stdout.", 6 | "type": "null" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/stdout/export.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/stdout/export.json", 4 | "title": "Export resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects every JSON Line emitted to stdout for the **Export** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/stdout/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/stdout/get.json", 4 | "title": "Get resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects the JSON Line emitted to stdout for the **Get** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/stdout/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/stdout/schema.json", 4 | "title": "Schema resource command stdout", 5 | "description": "Represents the JSON Schema that validates instances of the resource. DSC expects a resource that defines the `schema.command` field in its resource manifest to return this value for that command.", 6 | "type": "object", 7 | "required": [ 8 | "$schema", 9 | "type", 10 | "properties" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3.0/resource/stdout/validate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/stdout/validate.json", 4 | "title": "Validate resource operation stdout", 5 | "description": "Defines the JSON DSC expects a resource to emit to stdout for the **Validate** operation.", 6 | "type": "object", 7 | "required": [ 8 | "valid" 9 | ], 10 | "properties": { 11 | "valid": { 12 | "title": "Instance validity", 13 | "description": "Indicates whether the instance is valid for the resource." 14 | }, 15 | "reason": { 16 | "title": "Reason instance is invalid", 17 | "description": "Describes how and why the instance is invalid for the resource." 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /schemas/v3/bundled/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/bundled/outputs/resource/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/bundled/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/bundled/outputs/schema.vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object", 7 | "$defs": {} 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/definitions/commandExecutable.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", 4 | "title": "Executable Command Name", 5 | "description": "The name of the command to run.", 6 | "type": "string" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/definitions/hadErrors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", 4 | "title": "Had Errors", 5 | "description": "Indicates whether any of the DSC resources returned a non-zero exit code.", 6 | "type": "boolean" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/definitions/inputKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", 4 | "title": "Executable Command Input Type", 5 | "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", 6 | "type": "string", 7 | "enum": [ 8 | "env", 9 | "stdin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/definitions/instanceName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", 4 | "title": "Instance name", 5 | "description": "The short, human-readable name for a DSC resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", 6 | "type": "string", 7 | "pattern": "^[a-zA-Z0-9 ]+$", 8 | "minLength": 1 9 | } 10 | -------------------------------------------------------------------------------- /schemas/v3/definitions/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", 4 | "title": "Messages", 5 | "description": "A list of structured messages emitted by the DSC resources during an operation.", 6 | "type": "array", 7 | "items": { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/message.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /schemas/v3/definitions/parameters/dataTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json", 4 | "title": "Data Types", 5 | "description": "Defines the data type for the parameter value.", 6 | "type": "string", 7 | "enum": [ 8 | "string", 9 | "secureString", 10 | "int", 11 | "bool", 12 | "object", 13 | "secureObject", 14 | "array" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /schemas/v3/definitions/parameters/validValueTypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json", 4 | "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", 5 | "type": [ 6 | "string", 7 | "integer", 8 | "object", 9 | "array", 10 | "boolean" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3/definitions/resourceCapabilities.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceCapabilities.json", 4 | "title": "Resource capabilities", 5 | "description": "Define the operations you can invoke for a resource and how the resource behaves when invoked.", 6 | "type": "array", 7 | "items": { 8 | "type": "string", 9 | "enum": [ 10 | "get", 11 | "set", 12 | "setHandlesExist", 13 | "whatIf", 14 | "test", 15 | "delete", 16 | "export", 17 | "resolve" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /schemas/v3/definitions/resourceKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", 4 | "title": "Resource kind", 5 | "description": "Defines whether the resource is a normal DSC resource, a group resource, or an adapter resource. This property is only required for group resources.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "adapter", 10 | "group", 11 | "importer" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3/definitions/resourceType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", 4 | "title": "DSC resource fully qualified type name", 5 | "description": "The namespaced name of the DSC resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", 6 | "type": "string", 7 | "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/definitions/returnKind.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", 4 | "title": "Return Kind", 5 | "type": "string", 6 | "enum": [ 7 | "state", 8 | "stateAndDiff" 9 | ], 10 | "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/context.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", 4 | "title": "Operation context", 5 | "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", 6 | "type": "string", 7 | "enum": [ 8 | "resource", 9 | "configuration" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/duration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", 4 | "title": "Duration", 5 | "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", 6 | "type": "string", 7 | "format": "duration" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/endDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/executionType.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", 4 | "title": "Execution type", 5 | "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", 6 | "type": "string", 7 | "enum": [ 8 | "actual", 9 | "whatIf" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/operation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", 4 | "title": "Operation", 5 | "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", 6 | "type": "string", 7 | "enum": [ 8 | "get", 9 | "set", 10 | "test", 11 | "export" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/securityContext.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", 4 | "title": "Security context", 5 | "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", 6 | "type": "string", 7 | "enum": [ 8 | "current", 9 | "elevated", 10 | "restricted" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/startDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", 4 | "title": "Start date and time", 5 | "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", 6 | "type": "string", 7 | "format": "date-time" 8 | } 9 | -------------------------------------------------------------------------------- /schemas/v3/metadata/Microsoft.DSC/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", 4 | "title": "DSC Version", 5 | "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", 6 | "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/outputs/resource/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", 4 | "title": "dsc resource get result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3/outputs/resource/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc resource schema` command. This command always returns the DSC resource's JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/outputs/resource/set.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", 4 | "title": "dsc resource set result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3/outputs/resource/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", 4 | "title": "dsc resource test result", 5 | "description": "Describes the return data for a DSC resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", 6 | "anyOf": [ 7 | { 8 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" 9 | }, 10 | { 11 | "type": "array", 12 | "items": { 13 | "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /schemas/v3/outputs/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", 4 | "title": "DSC resource schema result", 5 | "description": "Describes the return data for a DSC resource from the `dsc schema` command. This command always returns a JSON schema document.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/resource/properties/exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json", 4 | "title": "Instance should exist", 5 | "description": "Indicates whether the DSC resource instance should exist.", 6 | "type": "boolean", 7 | "default": true, 8 | "enum": [ 9 | false, 10 | true 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3/resource/properties/inDesiredState.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json", 4 | "title": "Instance is in the Desired State", 5 | "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/resource/properties/purge.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json", 4 | "title": "Purge", 5 | "description": "Indicates that only the components described in the DSC resource should exist. If other components exist, the DSC resource is out of the desired state. When enforcing desired state, the DSC resource removes unmanaged components.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "writeOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/resource/properties/rebootRequested.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json", 4 | "title": "Reboot Requested", 5 | "description": "Indicates that the set operation requires a reboot before it's fully complete.", 6 | "type": [ 7 | "boolean", 8 | "null" 9 | ], 10 | "readOnly": true 11 | } 12 | -------------------------------------------------------------------------------- /schemas/v3/resource/stdout/delete.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/stdout/delete.json", 4 | "title": "Delete resource operation stdout", 5 | "description": "DSC does not expect the **Delete** operation for a resource to return any JSON to stdout.", 6 | "type": "null" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/resource/stdout/export.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/stdout/export.json", 4 | "title": "Export resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects every JSON Line emitted to stdout for the **Export** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/resource/stdout/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/stdout/get.json", 4 | "title": "Get resource operation stdout", 5 | "description": "Represents the actual state of a resource instance in DSC. DSC expects the JSON Line emitted to stdout for the **Get** operation to adhere to this schema.", 6 | "type": "object" 7 | } 8 | -------------------------------------------------------------------------------- /schemas/v3/resource/stdout/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/stdout/schema.json", 4 | "title": "Schema resource command stdout", 5 | "description": "Represents the JSON Schema that validates instances of the resource. DSC expects a resource that defines the `schema.command` field in its resource manifest to return this value for that command.", 6 | "type": "object", 7 | "required": [ 8 | "$schema", 9 | "type", 10 | "properties" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /schemas/v3/resource/stdout/validate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/stdout/validate.json", 4 | "title": "Validate resource operation stdout", 5 | "description": "Defines the JSON DSC expects a resource to emit to stdout for the **Validate** operation.", 6 | "type": "object", 7 | "required": [ 8 | "valid" 9 | ], 10 | "properties": { 11 | "valid": { 12 | "title": "Instance validity", 13 | "description": "Indicates whether the instance is valid for the resource." 14 | }, 15 | "reason": { 16 | "title": "Reason instance is invalid", 17 | "description": "Describes how and why the instance is invalid for the resource." 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /security_context_lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "security_context_lib" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | strip = true 8 | # optimize for size 9 | opt-level = 2 10 | # enable link time optimization to remove dead code 11 | lto = true 12 | 13 | [target.'cfg(target_os = "windows")'.dependencies] 14 | is_elevated = "0.1" 15 | 16 | [target.'cfg(not(target_os = "windows"))'.dependencies] 17 | nix = { version = "0.30", features = ["user"] } 18 | -------------------------------------------------------------------------------- /security_context_lib/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | #[derive(Debug, Clone, PartialEq, Eq)] 5 | pub enum SecurityContext { 6 | Admin, 7 | User, 8 | } 9 | 10 | #[cfg(target_os = "windows")] 11 | #[must_use] 12 | pub fn get_security_context() -> SecurityContext { 13 | use is_elevated::is_elevated; 14 | if is_elevated() { 15 | return SecurityContext::Admin; 16 | } 17 | SecurityContext::User 18 | } 19 | 20 | #[cfg(not(target_os = "windows"))] 21 | #[must_use] 22 | pub fn get_security_context() -> SecurityContext { 23 | use nix::unistd::Uid; 24 | 25 | if Uid::effective().is_root() { 26 | return SecurityContext::Admin; 27 | } 28 | SecurityContext::User 29 | } 30 | -------------------------------------------------------------------------------- /tools/dsctest/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dsctest" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | clap = { version = "4.1", features = ["derive"] } 10 | schemars = { version = "0.8" } 11 | serde = { version = "1.0", features = ["derive"] } 12 | serde_json = { version = "1.0", features = ["preserve_order"] } 13 | -------------------------------------------------------------------------------- /tools/dsctest/README.md: -------------------------------------------------------------------------------- 1 | # DSCTest Resource 2 | 3 | ## Sleep 4 | 5 | Example config: 6 | 7 | ```yaml 8 | $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json 9 | resources: 10 | - name: Sleep1 11 | type: Test/Sleep 12 | properties: 13 | seconds: 30 14 | ``` 15 | -------------------------------------------------------------------------------- /tools/dsctest/dscdelete.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/Delete", 4 | "version": "0.1.0", 5 | "get": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "delete", 9 | { 10 | "jsonInputArg": "--input", 11 | "mandatory": true 12 | } 13 | ] 14 | }, 15 | "delete": { 16 | "executable": "dsctest", 17 | "args": [ 18 | "delete", 19 | { 20 | "jsonInputArg": "--input", 21 | "mandatory": true 22 | } 23 | ] 24 | }, 25 | "schema": { 26 | "command": { 27 | "executable": "dsctest", 28 | "args": [ 29 | "schema", 30 | "-s", 31 | "delete" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tools/dsctest/dscexitcode.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/ExitCode", 4 | "version": "0.1.0", 5 | "get": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "exit-code", 9 | { 10 | "jsonInputArg": "--input" 11 | } 12 | ] 13 | }, 14 | "exitCodes": { 15 | "0": "Success", 16 | "8": "Placeholder from manifest for exit code 8" 17 | }, 18 | "schema": { 19 | "command": { 20 | "executable": "dsctest", 21 | "args": [ 22 | "schema", 23 | "-s", 24 | "exit-code" 25 | ] 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/dsctest/dscexport.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/Export", 4 | "version": "0.1.0", 5 | "export": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "export", 9 | { 10 | "jsonInputArg": "--input", 11 | "mandatory": true 12 | } 13 | ] 14 | }, 15 | "schema": { 16 | "command": { 17 | "executable": "dsctest", 18 | "args": [ 19 | "schema", 20 | "-s", 21 | "export" 22 | ] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/dsctest/dscexporter.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/Exporter", 4 | "version": "0.1.0", 5 | "kind": "exporter", 6 | "export": { 7 | "executable": "dsctest", 8 | "args": [ 9 | "exporter", 10 | { 11 | "jsonInputArg": "--input", 12 | "mandatory": true 13 | } 14 | ] 15 | }, 16 | "schema": { 17 | "command": { 18 | "executable": "dsctest", 19 | "args": [ 20 | "schema", 21 | "-s", 22 | "exporter" 23 | ] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/dsctest/dscindesiredstate.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/InDesiredState", 4 | "version": "0.1.0", 5 | "test": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "in-desired-state", 9 | { 10 | "jsonInputArg": "--input", 11 | "mandatory": true 12 | } 13 | ], 14 | "return": "state" 15 | }, 16 | "schema": { 17 | "command": { 18 | "executable": "dsctest", 19 | "args": [ 20 | "schema", 21 | "-s", 22 | "in-desired-state" 23 | ] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/dsctest/dsctrace.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/Trace", 4 | "version": "0.1.0", 5 | "get": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "trace" 9 | ] 10 | }, 11 | "set": { 12 | "executable": "dsctest", 13 | "args": [ 14 | "trace" 15 | ] 16 | }, 17 | "test": { 18 | "executable": "dsctest", 19 | "args": [ 20 | "trace" 21 | ] 22 | }, 23 | "schema": { 24 | "command": { 25 | "executable": "dsctest", 26 | "args": [ 27 | "schema", 28 | "-s", 29 | "trace" 30 | ] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tools/dsctest/dscwhatif.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/WhatIf", 4 | "version": "0.1.0", 5 | "get": { 6 | "executable": "dsctest", 7 | "args": [ 8 | "whatif" 9 | ] 10 | }, 11 | "set": { 12 | "executable": "dsctest", 13 | "args": [ 14 | "whatif" 15 | ], 16 | "return": "state" 17 | }, 18 | "whatIf": { 19 | "executable": "dsctest", 20 | "args": [ 21 | "whatif", 22 | "-w" 23 | ], 24 | "return": "state" 25 | }, 26 | "schema": { 27 | "command": { 28 | "executable": "dsctest", 29 | "args": [ 30 | "schema", 31 | "-s", 32 | "what-if" 33 | ] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tools/dsctest/src/delete.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct Delete { 10 | #[serde(rename = "deleteCalled", skip_serializing_if = "Option::is_none")] 11 | pub delete_called: Option, 12 | #[serde(rename = "_exist")] 13 | pub exist: bool, 14 | } 15 | -------------------------------------------------------------------------------- /tools/dsctest/src/exist.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | pub enum State { 9 | Present, 10 | Absent, 11 | } 12 | 13 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 14 | #[serde(deny_unknown_fields)] 15 | pub struct Exist { 16 | #[serde(skip_serializing_if = "Option::is_none")] 17 | pub state: Option, 18 | #[serde(rename = "_exist")] 19 | pub exist: bool, 20 | } 21 | -------------------------------------------------------------------------------- /tools/dsctest/src/exit_code.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct ExitCode { 10 | #[serde(rename = "exitCode")] 11 | pub exit_code: i32, 12 | } 13 | -------------------------------------------------------------------------------- /tools/dsctest/src/export.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct Export { 10 | /// Number of instances to return 11 | pub count: u64, 12 | } 13 | -------------------------------------------------------------------------------- /tools/dsctest/src/exporter.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | use serde_json::{Map, Value}; 7 | 8 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 9 | pub struct Resource { 10 | pub name: String, 11 | pub r#type: String, 12 | pub properties: Map, 13 | } 14 | 15 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 16 | #[serde(deny_unknown_fields)] 17 | pub struct Exporter { 18 | #[serde(rename = "typeNames")] 19 | pub type_names: Vec, 20 | } 21 | -------------------------------------------------------------------------------- /tools/dsctest/src/in_desired_state.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[allow(clippy::struct_field_names)] 8 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 9 | #[serde(deny_unknown_fields)] 10 | pub struct InDesiredState { 11 | #[serde(rename = "_inDesiredState", skip_serializing_if = "Option::is_none")] 12 | pub in_desired_state: Option, 13 | #[serde(rename = "valueOne")] 14 | pub value_one: i32, 15 | #[serde(rename = "valueTwo")] 16 | pub value_two: i32, 17 | } 18 | -------------------------------------------------------------------------------- /tools/dsctest/src/sleep.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct Sleep { 10 | /// Number of seconds to sleep 11 | pub seconds: u64, 12 | } 13 | -------------------------------------------------------------------------------- /tools/dsctest/src/trace.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct Trace { 10 | pub level: String, 11 | } 12 | -------------------------------------------------------------------------------- /tools/dsctest/src/whatif.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct WhatIf { 10 | #[serde(rename = "executionType")] 11 | pub execution_type: String, 12 | } 13 | -------------------------------------------------------------------------------- /tools/test_group_resource/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_group_resource" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | clap = { version = "4.1", features = ["derive"] } 8 | dsc_lib = { path = "../../dsc_lib" } 9 | schemars = { version = "0.8.12" } 10 | serde = { version = "1.0", features = ["derive"] } 11 | serde_json = { version = "1.0", features = ["preserve_order"] } 12 | -------------------------------------------------------------------------------- /tools/test_group_resource/src/args.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | use clap::{Parser, Subcommand}; 5 | 6 | #[derive(Debug, Parser)] 7 | #[clap(name = "testResource", version = "0.1.0", about = "This resource returns test data.", long_about = None)] 8 | pub struct Args { 9 | /// The subcommand to run 10 | #[clap(subcommand)] 11 | pub subcommand: SubCommand, 12 | } 13 | 14 | #[derive(Debug, PartialEq, Eq, Subcommand)] 15 | pub enum SubCommand { 16 | #[clap(name = "list", about = "Returns some test resources.")] 17 | List, 18 | #[clap(name = "listmissingrequires", about = "Returns some test resources with invalid schema.")] 19 | ListMissingRequires, 20 | } 21 | -------------------------------------------------------------------------------- /tools/test_group_resource/testGroup.dsc.resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", 3 | "type": "Test/TestGroup", 4 | "kind": "adapter", 5 | "version": "0.1.0", 6 | "get": { 7 | "executable": "test_group_resource", 8 | "args": [ 9 | "get" 10 | ] 11 | }, 12 | "schema": { 13 | "command": { 14 | "executable": "test_group_resource", 15 | "args": [ 16 | "schema" 17 | ] 18 | } 19 | }, 20 | "adapter": { 21 | "list": { 22 | "executable": "test_group_resource", 23 | "args": [ 24 | "list" 25 | ] 26 | }, 27 | "config": "sequence" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tree-sitter-dscexpression/.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | 3 | src/*.json linguist-generated 4 | src/parser.c linguist-generated 5 | src/tree_sitter/* linguist-generated 6 | 7 | bindings/** linguist-generated 8 | binding.gyp linguist-generated 9 | setup.py linguist-generated 10 | Makefile linguist-generated 11 | Package.swift linguist-generated 12 | -------------------------------------------------------------------------------- /tree-sitter-dscexpression/.gitignore: -------------------------------------------------------------------------------- 1 | # Rust artifacts 2 | target/ 3 | 4 | # Node artifacts 5 | build/ 6 | prebuilds/ 7 | node_modules/ 8 | *.tgz 9 | 10 | # Swift artifacts 11 | .build/ 12 | Package.swift 13 | 14 | # Go artifacts 15 | go.sum 16 | _obj/ 17 | 18 | # Python artifacts 19 | .venv/ 20 | dist/ 21 | *.egg-info 22 | *.whl 23 | pyproject.toml 24 | setup.py 25 | 26 | # C artifacts 27 | *.a 28 | *.so 29 | *.so.* 30 | *.dylib 31 | *.dll 32 | *.pc 33 | Makefile 34 | 35 | # Example dirs 36 | /examples/*/ 37 | 38 | # Grammar volatiles 39 | *.wasm 40 | *.obj 41 | *.o 42 | 43 | .editorconfig 44 | -------------------------------------------------------------------------------- /tree-sitter-dscexpression/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tree-sitter-dscexpression" 3 | description = "DSCExpression grammar for the tree-sitter parsing library" 4 | version = "1.0.0" 5 | keywords = ["incremental", "parsing", "DSCExpression"] 6 | categories = ["parsing", "text-editors"] 7 | repository = "https://github.com/powershell/dsc" 8 | edition = "2021" 9 | license = "MIT" 10 | 11 | build = "bindings/rust/build.rs" 12 | include = [ 13 | "bindings/rust/*", 14 | "grammar.js", 15 | "queries/*", 16 | "src/*", 17 | ] 18 | 19 | [lib] 20 | path = "bindings/rust/lib.rs" 21 | 22 | [profile.release] 23 | strip = true 24 | # optimize for size 25 | opt-level = 2 26 | # enable link time optimization to remove dead code 27 | lto = true 28 | 29 | [dependencies] 30 | tree-sitter-rust = "0.24" 31 | tree-sitter = "0.25" 32 | tree-sitter-language = "0.1" 33 | 34 | [build-dependencies] 35 | cc = "1.2" 36 | -------------------------------------------------------------------------------- /tree-sitter-dscexpression/build.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | param( 5 | [switch]$UpdatePackages 6 | ) 7 | 8 | function Invoke-NativeCommand($cmd) { 9 | Invoke-Expression $cmd 10 | if ($LASTEXITCODE -ne 0) { 11 | throw "Command $cmd failed with exit code $LASTEXITCODE" 12 | } 13 | } 14 | 15 | $env:TREE_SITTER_VERBOSE=1 16 | 17 | if ($null -eq (Get-Command tree-sitter -ErrorAction Ignore)) { 18 | cargo install tree-sitter-cli 19 | } 20 | 21 | Invoke-NativeCommand 'tree-sitter init --update' 22 | Invoke-NativeCommand 'tree-sitter generate --build' 23 | Invoke-NativeCommand 'tree-sitter test' 24 | -------------------------------------------------------------------------------- /tree-sitter-dscexpression/tree-sitter.json: -------------------------------------------------------------------------------- 1 | { 2 | "grammars": [ 3 | { 4 | "name": "dscexpression", 5 | "camelcase": "Dscexpression", 6 | "scope": "source.dscexpression", 7 | "path": ".", 8 | "file-types": null, 9 | "injection-regex": "^dscexpression$" 10 | } 11 | ], 12 | "metadata": { 13 | "version": "1.0.0", 14 | "license": "MIT", 15 | "description": "Dscexpression grammar for tree-sitter", 16 | "links": { 17 | "repository": "https://github.com/tree-sitter/tree-sitter-dscexpression" 18 | } 19 | }, 20 | "bindings": { 21 | "c": false, 22 | "go": false, 23 | "node": false, 24 | "python": false, 25 | "rust": true, 26 | "swift": false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /wmi-adapter/Tests/test_wmi_config.dsc.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration for reading data from Windows WMI 2 | $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json 3 | resources: 4 | - name: Get info from WMI 5 | type: Microsoft.Windows/WMI 6 | properties: 7 | resources: 8 | - name: Get OS Info 9 | type: root.cimv2/Win32_OperatingSystem 10 | properties: 11 | caption: 12 | version: 13 | osarchitecture: 14 | - name: Get BIOS Info 15 | type: root.cimv2/Win32_BIOS 16 | - name: Get Processor Info 17 | type: root.cimv2/Win32_Processor 18 | -------------------------------------------------------------------------------- /wmi-adapter/copy_files.txt: -------------------------------------------------------------------------------- 1 | wmi.resource.ps1 2 | wmi.dsc.resource.json -------------------------------------------------------------------------------- /y2j/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "y2j" 3 | version = "1.0.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | codegen-units = 1 # reduces binary size by ~2% 8 | debug = "full" # No one needs an undebuggable release binary 9 | lto = true # reduces binary size by ~14% 10 | opt-level = "s" # reduces binary size by ~25% 11 | panic = "abort" # reduces binary size by ~50% in combination with -Zbuild-std-features=panic_immediate_abort 12 | split-debuginfo = "packed" # generates a seperate *.dwp/*.dSYM so the binary can get stripped 13 | strip = "symbols" # See split-debuginfo - allows us to drop the size by ~65% 14 | 15 | [dependencies] 16 | serde_json = { version = "1.0", features = ["preserve_order"] } 17 | serde_yaml = { version = "0.9" } 18 | syntect = { version = "5.0", features = ["default-fancy"], default-features = false } 19 | -------------------------------------------------------------------------------- /y2j/README.md: -------------------------------------------------------------------------------- 1 | # Y2J 2 | 3 | Simple tool to convert YAML -> JSON -> YAML making it easier to read by a person. 4 | 5 | ## Input 6 | 7 | This command has no parameters and takes input only via STDIN (as UTF-8). 8 | 9 | If the input is JSON, then it outputs YAML. 10 | If the input is YAML, then it outputs pretty JSON. 11 | 12 | JSON input is expected to be a single JSON document. 13 | 14 | ## Example 15 | 16 | Get the JSON schema for registry resource as YAML: 17 | 18 | ```powershell 19 | registry schema | y2j 20 | ``` 21 | 22 | Convert back to JSON to get pretty print JSON: 23 | 24 | ```powershell 25 | registry schema | y2j | y2j 26 | ``` 27 | --------------------------------------------------------------------------------