Beware where you place Comment based Help

In working on the PSWordPress Module that Stephen Owen (@foxdeploy) has started I came across an interesting issue after running my Pester tests which calls – $ModuleFunction.Definition.Contains(‘.Synopsis’) | Should be True to check for comment based help – and it was failing even though I had Comment Based help in there. The problem was that the Help was Above the Function Keyword – so this means that it wasn’t carried through to the $ModuleFunction.Definition property. So this is a good example of why CommentBased Help for a module should be held within the initial Curly Bracket for the function.

1 thought on “Beware where you place Comment based Help”

  1. I Actually posted this Post using the PSWordPress Module and using the New-WordPressPost Function

    I will Add more detail (inc pictures) into this in the coming days

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.