Skip to content

docs: add [OutputType()] declarations and .OUTPUTS help to Test-FeatureFlag and Test-Condition #42

@HeyItsGilbert

Description

@HeyItsGilbert

Summary

Both Test-FeatureFlag and Test-Condition always return [bool] but neither declares an [OutputType()] attribute nor a .OUTPUTS help block. For functions whose entire purpose is to return a boolean that gates behavior, this is a missing piece of the public contract.

Files

  • Gatekeeper/Public/Test-FeatureFlag.ps1
  • Gatekeeper/Public/Test-Condition.ps1

Fix

Add to each function:

function Test-FeatureFlag {
    [CmdletBinding()]
    [OutputType([bool])]
    param (
        ...
    )

    <#
    .OUTPUTS
    System.Boolean
    Returns $true if an Allow rule matches, $false otherwise.
    #>

Then regenerate the external help XML with PlatyPS so the ## OUTPUTS section in the .md files is populated.

Notes

  • Good first issue
  • Found by Brent Tlackburn and Shawn Wee!-ler

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions