Tool for creating PowerShell Desired State Configuration composite resources from configurations
Перейти к файлу
microsoft-github-policy-service[bot] 06205f9a11
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2022-11-28 19:10:58 +00:00
CompositeResource merge 2018-11-12 16:54:51 -06:00
Runbooks script names 2018-11-12 23:06:46 -06:00
Tests/Unit Skip the use of scriptblock and use string for Script parameter 2018-09-17 17:37:44 +02:00
.gitignore Initial commit 2018-09-07 13:32:57 -07:00
LICENSE Initial commit 2018-09-07 13:33:02 -07:00
README.md Update README.md 2019-03-18 14:54:29 -07:00
SECURITY.md Microsoft mandatory file 2022-08-17 14:52:03 +00:00
appveyor.yml script names 2018-11-12 23:06:46 -06:00

README.md

Composite Resource Module

Build status

The purpose of this project is to provide a tool for converting PowerShell Desired State Configuration configurations to composite resources.

Installation:

Install-Module -Name compositeresource

Usage:

The tool does not convert a script file, it converts a configuration. This way writing out to a temporary file is never required.

From configuration file

If you are using MyConfiguration.ps1:

Configuration sampleConfig
{

}

you must first load the confguration into memory by executing MyConfiguration.ps1.

ConvertTo-CompositeResource -ConfigurationName 'sampleConfig' -Author 'Name' -Description 'Text'

From script

You can also compose the entire configuration inline and pass it in with the -script parameter.

$configurationScript = @"
Configuration Example3
{
    Import-DscResource -ModuleName PSDesiredStateConfiguration

    node localhost
    {
        WindowsFeature 'NetFramework45'
        {
            Name   = 'NET-Framework-45-Core'
            Ensure = 'Present'
        }
    }
}
"@

ConvertTo-CompositeResource -Script $configurationScript -Author 'Name' -Description 'Text'

Output:

<no command output returned when successful>

By default the tool will write a new folder based on the configuration name + 'DSC', e.g. 'TestDSC'. The folder contains a version folder which then contains a module and manifest. The module should be immediately functional once it is copied into a path present in $env:PSModulePath.

To test if the resource is available, run the command:

Get-DscResource

Release Notes

09/07/2018 - Michael Greene and Johan Ljunggren collaborated on a minimum viable product for the solution and published the result as an open source project on GitHub.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.