< Back

ConvertTo-CompositeResource

Mon Jan 13, 2020 4:15 am

NAME ConvertTo-CompositeResource



SYNOPSIS

Converts a PowerShell Desired State Configuration configuration to a

composite resources.





SYNTAX

ConvertTo-CompositeResource [-ResourceName <String>] [-ModuleName <String>] -ModuleVersion <Version> [-Author

<String>] [-Description <String>] [-OutputPath <String>] [<CommonParameters>]



ConvertTo-CompositeResource -ConfigurationName <String> [-ResourceName <String>] [-ModuleName <String>]

-ModuleVersion <Version> [-Author <String>] [-Description <String>] [-OutputPath <String>] [<CommonParameters>]



ConvertTo-CompositeResource -Script <String> [-ResourceName <String>] [-ModuleName <String>] -ModuleVersion

<Version> [-Author <String>] [-Description <String>] [-OutputPath <String>] [<CommonParameters>]





DESCRIPTION

Converts a PowerShell Desired State Configuration configuration to a

composite resources.



It is possible to convert several configuration to composite resource

to the same resource module. Use the same ModuleName, ModuleVersion

and OutputPath for all the configurations that are converted.





PARAMETERS

-ConfigurationName <String>

The configuration name to convert into a composite resource. The

configuration name must exist in the session.

If this is used, then the parameter Script cannot be used.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Script <String>

A script block containing the configuration to convert into a composite

resource.

If this is used, then the parameter ConfigurationName cannot be used.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceName <String>

The name of the composite resource that will be created. Defaults to

the same name as the configuration name.



Required? false

Position? named

Default value $ConfigurationName

Accept pipeline input? false

Accept wildcard characters? false



-ModuleName <String>

The name of the resource module that will contain the new composite

resource. Defaults to the same name as the configuration name, suffixed

with DSC, e.g. ModuleNameDSC.



Required? false

Position? named

Default value "$($ConfigurationName)DSC"

Accept pipeline input? false

Accept wildcard characters? false



-ModuleVersion <Version>

The version number of the resource module being created.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Author <String>

The name of the author of the resource module. This will be added to the

module manifest. Defaults to $env:USERNAME.



Required? false

Position? named

Default value $env:USERNAME

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

The description of the resource module. This will be added to the

module manifest.

Defaults to 'Automatically generated by the Composite Resource module.'



Required? false

Position? named

Default value Automatically generated by the Composite Resource module.

http://github.com/microsoft/compositeresource

Accept pipeline input? false

Accept wildcard characters? false



-OutputPath <String>

The path to where the new resource module will be created. Defaults to

the current folder.

If there are already a resource module with the same name at the output

path, that module will be updated.



Required? false

Position? named

Default value .\\

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

No command output returned when successful.





NOTES





Get more information, and how to contribute, at https://github.com/Microsoft/CompositeResource.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>ConvertTo-CompositeResource -ConfigurationName 'Test' -Author 'Name' -Description 'Text'















RELATED LINKS