PowerTip: Use PowerShell to Hide Parameter From IntelliSense

Doctor Scripto

Summary: Learn how to use Windows PowerShell to hide a parameter from IntelliSense. Hey, Scripting Guy! Question How can I use Windows PowerShell to hide a parameter from IntelliSense?

Hey, Scripting Guy! Answer Introduced in Windows PowerShell 4.0, you can specify the DontShow attribute
           for the [parameter()] type to hide that parameter from IntelliSense:

Function Test-Something {

    [cmdletbinding()]

    Param (

        [parameter(DontShow)]

        $HiddenParameter,

        [parameter()]

        $Computername,

        [parameter()]

        $NewValue

    )

}

Cycling through parameters will not show $HiddenParameter:

PS C:> Test-Something – #Tab through parameters

0 comments

Discussion is closed.

Feedback usabilla icon