MicrosoftDocs / PowerShell-Docs-DSC

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

Invoke-DscResource can't be used with composite resources #258

Closed DennisL68 closed 4 months ago

DennisL68 commented 4 months ago

Type of issue

Missing information

Feedback

A composite resource is a configuration, it never gets loaded by the LCM. (A configuration needs to be compiled and the resources it calls are the ones that the LCM needs to load). This is why an Invoke-DscResource on a composite resource will not work and you should call it on the underlying resource.

See, http://nanalakshmanan.com/blog/Composite-Resources-Explained/

Page URL

https://learn.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/invoke-dscresource?view=dsc-2.0

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs-DSC/blob/main/dsc/dsc-2.0/PSDesiredStateConfiguration/Invoke-DscResource.md

Author

@sdwheeler

Document Id

1ab73932-fc3e-496b-633a-31f01704dec9