Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Invoke-AppveyorAfterTestTask: Exception Calling New-DscResourcePowerShellHelp when Type is 'Wiki' #332

Closed
X-Guardian opened this issue Jul 4, 2019 · 2 comments · Fixed by #334
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@X-Guardian
Copy link
Contributor

Details of the problem, bug, or enhancement

The changes to New-DscResourcePowerShellHelp made in #325 are causing Invoke-AppveyorAfterTestTask to throw a non-terminating exception calling the function with what is now a non-existing parameter, OutputPath. My fault as I didn't know this function was called from here when I wrote PR #325.

Verbose logs showing the problem (if applicable)

Invoke-AppveyorAfterTestTask `
    -Type 'Wiki' `
    -MainModulePath $mainModuleFolder `
    -ResourceModuleName $moduleName
 
New-DscResourcePowerShellHelp : A parameter cannot be found that matches parameter name 'OutputPath'.
At C:\projects\officeonlineserverdsc\DscResource.Tests\AppVeyor.psm1:1051 char:39
+         New-DscResourcePowerShellHelp -OutputPath $docoPath -ModulePa ...
+                                       ~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-DscResourcePowerShellHelp], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-DscResourcePowerShellHelp
 

Suggested solution to the issue

Options are:

  1. Restore the OutputPath parameter back to New-DscResourcePowerShellHelp. Easy enough to do but looking into this, the PowerShell help files are not making it into the final published module. Look at CertificateDsc and ActiveDirectoryCsDsc as examples that have the 'Wiki' parameter on Invoke-AppveyorAfterTestTask and the AppVeyor build logs show the help files being built, but neither of them contain the files when installed from the PowerShell Gallery. Is the ApppVeyor artifact not used for populating the gallery?

  2. Remove the 'OutputPath' parameter from the New-DscResourcePowerShellHelp function call in Invoke-AppveyorAfterTestTask. This would output the help files into the relevant resource's en-US directory, but if the AppVeyor artifact isn't being used for populating the gallery, they will still get lost.

  3. Remove the call to New-DscResourcePowerShellHelp from Invoke-AppveyorAfterTestTask. It doesn't make sense being in the 'Wiki' type anyway and look for another solution to populate the help files. I prefer having the help files present within the Git repo, so they can be seen and verified before publishing. I was thinking maybe of another opt-in metatest that verified they existed and were up to date. It could then prompt to manually run the script to bring them up-to-date if required.

Thoughts anyone?

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Jul 5, 2019
@PlagueHO
Copy link
Contributor

PlagueHO commented Jul 5, 2019

Just to answer one of your questions: The AppVeyor artifact is not being used to publish to the PS Gallery. Katies scripts I think rebuild the artifact locally and publish it from there.

I'd go with restoring the OutputPath parameter, because I suspect other maintainers (possibly SharepointDsc) that use this too and a breaking change to the signature might cause other problems.

Also, we don't store the documentation in the Dev branch, only the master branch - and this is all generated during deployment using automation that Katie looks after.

So making too many changes to these processes without having more control over the deployment process is going to be risky. So I'd suggest not making too many changes to this process...yet 😁

@johlju
Copy link
Contributor

johlju commented Jul 10, 2019

I agree to add back the OutputPath parameter, but if it is not provided then use the current behavior. I just saw this error to, and thought of submitting an issue. Awesome that you are on top of things @X-Guardian! 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants