gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
171 stars 42 forks source link

MOF Files are identified incorrectly #403

Closed raandree closed 1 year ago

raandree commented 1 year ago

Pull Request

Pull Request (PR) description

The task Build_DscResourcesToExport_ModuleBuilder did not properly look for DSC MOF-based resources and DSC composite resources. It uses Get-ChildItem -Include '*.schema.mof' -File which in some cases returns more than just *.schema.mof files.

https://github.com/gaelcolas/Sampler/blob/0df39036bac42ecdf15ed956d8bc5e3fc30995c7/.build/tasks/Build-Module.ModuleBuilder.build.ps1#L359

Discovering the name of DSC composite resources must be done differently, hence a Get-Psm1SchemaName.ps1 was added.

The changes of this PR mainly add support for DSC composite resources.

Fixed

Added

Task list


This change is Reviewable

codecov[bot] commented 1 year ago

Codecov Report

Merging #403 (5f76925) into main (5d3f4ed) will increase coverage by 0%. The diff coverage is 93%.

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #403   +/-   ##
===================================
  Coverage    81%    81%           
===================================
  Files        41     42    +1     
  Lines      2225   2244   +19     
===================================
+ Hits       1807   1826   +19     
  Misses      418    418           
Impacted Files Coverage Δ
.build/tasks/Build-Module.ModuleBuilder.build.ps1 90% <90%> (+<1%) :arrow_up:
Sampler/Public/Get-Psm1SchemaName.ps1 100% <100%> (ø)