MicrosoftDocs / PowerShell-Docs-DSC

Documentation for PowerShell Desired State Configuration
https://learn.microsoft.com/powershell/dsc/overview
Creative Commons Attribution 4.0 International
31 stars 36 forks source link

[DSC 2 - Write and compile a DSC Configuration]The example should include Example(configuration name) at the end of the configuration example #171

Closed Smoovsky closed 1 year ago

Smoovsky commented 1 year ago

The example should include Example(configuration name) at the end of the configuration example.

Current:

Configuration Example {
    # Import the module that contains the Registry DSC Resource.
    Import-DscResource -ModuleName PSDscResources

    # The Registry DSC Resource can ensure the state of registry keys
    Registry DscTest {
        Key       = 'HKEY_CURRENT_USER\DscTest'
        ValueName = 'Example'
        Ensure    = 'Present'
        ValueData = 'Test Value'
        ValueType = 'String'
    }
}

Proposed:

Configuration Example {
    # Import the module that contains the Registry DSC Resource.
    Import-DscResource -ModuleName PSDscResources

    # The Registry DSC Resource can ensure the state of registry keys
    Registry DscTest {
        Key       = 'HKEY_CURRENT_USER\DscTest'
        ValueName = 'Example'
        Ensure    = 'Present'
        ValueData = 'Test Value'
        ValueType = 'String'
    }
}

Example

Without the configuration name at the end, the configuration won't be compiled when you call the script.

Also I'm not sure if the doc should clarify that you can define multiple configurations in one file and just include names of all configuration at the end and calling the script will result in all configurations to be compiled at once.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

sdwheeler commented 1 year ago

That information is in the article under the Compile the configuration section.