devblackops / NetScaler

PowerShell module for interacting with Citrix NetScaler via the Nitro API
Apache License 2.0
69 stars 32 forks source link

Update comment-based help on all functions #29

Closed devblackops closed 8 years ago

devblackops commented 8 years ago

I've added a Pester test to validate that comment-based help is accurate for all functions. These tests are executed by the default psake task and will cause the build to fail if any of the help tests fail.

Current Behavior

Builds will fail until all comment-based help is updated.

Solution

Update comment-based help.

Context

These tests ensure a higher quality module by enforcing us to create accurate help documentation for all functions.

iainbrighton commented 8 years ago

@devblackops Running the new test results in a load of missing definitions for the Confirm and -WhatIf parameters. Shouldn't these be added as common parameters?

iainbrighton commented 8 years ago

Changing the Help.Tests.ps1 to this results in far less "clutter":

## Add Confirm and WhatIf to the excluded parameters
$common = 'Debug', 'ErrorAction', 'ErrorVariable', 'InformationAction', 'InformationVariable', 'OutBuffer', 'OutVariable',
'PipelineVariable', 'Verbose', 'WarningAction', 'WarningVariable', 'Confirm', 'WhatIf'

$parameters = $command.ParameterSets.Parameters | Sort-Object -Property Name -Unique | Where-Object { $_.Name -notin $common }
$parameterNames = $parameters.Name

## Without the filter, WhatIf and Confirm parameters are still flagged in "finds help parameter in code" test
$helpParameters = $help.Parameters.Parameter | Where-Object { $_.Name -notin $common } | Sort -Property Name -Unique
$helpParameterNames = $helpParameters.Name

With this change there are currently 40 help failures (compared with the previous 243 that included -Confirm and -WhatIf!)

devblackops commented 8 years ago

Agreed. Confirm and WhatIf should be excluded from these checks. I'll modify the Pester test.

devblackops commented 8 years ago

-Confirm and -WhatIf are not excluded from help tests. I also went through and corrected typos/missing information in comment-based help. Tests pass now!