diff --git a/CHANGELOG.md b/CHANGELOG.md index b34e101..bac31d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- `New-DscMofResourceWikiPage` + - Removed unused mandatory parameter ([issue #85](https://github.com/dsccommunity/DscResource.DocGenerator/issues/85)). + ## [0.10.0] - 2021-08-05 ### Added diff --git a/source/Private/New-DscMofResourceWikiPage.ps1 b/source/Private/New-DscMofResourceWikiPage.ps1 index 59a9bda..5fd10ac 100644 --- a/source/Private/New-DscMofResourceWikiPage.ps1 +++ b/source/Private/New-DscMofResourceWikiPage.ps1 @@ -16,17 +16,12 @@ The path to the root of the DSC resource module (where the PSD1 file is found, not the folder for and individual DSC resource). - .PARAMETER BuiltModulePath - The path to the root of the built DSC resource module, e.g. - 'output/MyResource/1.0.0'. - .PARAMETER Force Overwrites any existing file when outputting the generated content. .EXAMPLE New-DscMofResourceWikiPage ` -SourcePath C:\repos\MyResource\source ` - -BuiltModulePath C:\repos\MyResource\output\MyResource\1.0.0 ` -OutputPath C:\repos\MyResource\output\WikiContent This example shows how to generate wiki documentation for a specific module. @@ -46,10 +41,6 @@ function New-DscMofResourceWikiPage [System.String] $SourcePath, - [Parameter(Mandatory = $true)] - [System.String] - $BuiltModulePath, - [Parameter()] [System.Management.Automation.SwitchParameter] $Force diff --git a/source/Public/New-DscResourceWikiPage.ps1 b/source/Public/New-DscResourceWikiPage.ps1 index 7d60abd..d689ac6 100644 --- a/source/Public/New-DscResourceWikiPage.ps1 +++ b/source/Public/New-DscResourceWikiPage.ps1 @@ -55,7 +55,13 @@ function New-DscResourceWikiPage $Force ) - New-DscMofResourceWikiPage @PSBoundParameters + $newDscMofResourceWikiPageParameters = @{ + OutputPath = $OutputPath + SourcePath = $SourcePath + Force = $Force + } + + New-DscMofResourceWikiPage @newDscMofResourceWikiPageParameters New-DscClassResourceWikiPage @PSBoundParameters diff --git a/tests/unit/private/New-DscMofResourceWikiPage.Tests.ps1 b/tests/unit/private/New-DscMofResourceWikiPage.Tests.ps1 index d6a27b8..dfa17d8 100644 --- a/tests/unit/private/New-DscMofResourceWikiPage.Tests.ps1 +++ b/tests/unit/private/New-DscMofResourceWikiPage.Tests.ps1 @@ -260,7 +260,6 @@ Configuration Example $script:newDscResourceWikiPageOutput_parameters = @{ SourcePath = $script:mockSourcePath OutputPath = $script:mockOutputPath - BuiltModulePath = '.' # Not used for MOF-based resources Verbose = $true } diff --git a/tests/unit/public/New-DscResourceWikiPage.Tests.ps1 b/tests/unit/public/New-DscResourceWikiPage.Tests.ps1 index 7f7d63a..89f6ed9 100644 --- a/tests/unit/public/New-DscResourceWikiPage.Tests.ps1 +++ b/tests/unit/public/New-DscResourceWikiPage.Tests.ps1 @@ -35,6 +35,17 @@ InModuleScope $script:moduleName { } $script:newDscResourceWikiPage_parameterFilter = { + $OutputPath -eq $script:mockOutputPath -and ` + $SourcePath -eq $script:mockSourcePath + } + + $script:newDscClassResourceWikiPage_parameterFilter = { + $OutputPath -eq $script:mockOutputPath -and ` + $SourcePath -eq $script:mockSourcePath -and ` + $BuiltModulePath -eq $script:mockBuildModulePath + } + + $script:newDscCompositeResourceWikiPage_parameterFilter = { $OutputPath -eq $script:mockOutputPath -and ` $SourcePath -eq $script:mockSourcePath -and ` $BuiltModulePath -eq $script:mockBuildModulePath @@ -46,11 +57,11 @@ InModuleScope $script:moduleName { Mock ` -CommandName New-DscClassResourceWikiPage ` - -ParameterFilter $script:newDscResourceWikiPage_parameterFilter + -ParameterFilter $script:newDscClassResourceWikiPage_parameterFilter Mock ` -CommandName New-DscCompositeResourceWikiPage ` - -ParameterFilter $script:newDscResourceWikiPage_parameterFilter + -ParameterFilter $script:newDscCompositeResourceWikiPage_parameterFilter It 'Should not throw an exception' { { New-DscResourceWikiPage @script:newDscResourceWikiPage_parameters } | Should -Not -Throw @@ -64,12 +75,12 @@ InModuleScope $script:moduleName { Assert-MockCalled ` -CommandName New-DscClassResourceWikiPage ` - -ParameterFilter $script:newDscResourceWikiPage_parameterFilter ` + -ParameterFilter $script:newDscClassResourceWikiPage_parameterFilter ` -Exactly -Times 1 Assert-MockCalled ` -CommandName New-DscCompositeResourceWikiPage ` - -ParameterFilter $script:newDscResourceWikiPage_parameterFilter ` + -ParameterFilter $script:newDscCompositeResourceWikiPage_parameterFilter ` -Exactly -Times 1 } }