Beware where you place Comment based Help

Ryan YatesConsultant

Just a dude in his 30's doing things in Tech & trying to break the stigma's around talking about Mental Health

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.