How to know what all content is accepted by a parameter

Welcome Forums General PowerShell Q&A How to know what all content is accepted by a parameter

This topic contains 3 replies, has 3 voices, and was last updated by

1 year, 3 months ago.

  • Author
  • #83312

    Points: 4
    Rank: Member

    Hey All,

    I'm still a beginner. Have been watching multiple videos and reading contents from website.

    So far, all I get to know that to get more detailed information about any cmdlets, you can use "Get-help %enter the cmdlet%" and they include "-full" or "-examples" or "detailed" etc.

    But, what I need is whether there are any ways to know what list of strings is accepted by a specific parameter after the cmdlets.

    Get-help ADPowershellWebAccess -Full
    —> This will give me full detailed information of the cmdlet ADPowershellWebAccess.

    But, what about this:
    Add-PswaAuthorizationRule -ConfigurationName
    —> Now, here I don't know what are the string(s) name which can be entered after -ConfigurationName parameter. Thus, is there anyway to list down all the strings which can be used after the parameter -ConfigurationName.

    I know.. I know.. I'm being silly but if I could get that information, that'll make my life better. And hope I make some sense.

    Peace & Cheers,
    Sammy Boy.

  • #83345

    Points: 12
    Rank: Member

    Specifies the name of the Windows PowerShell session configuration, also known as runspace, to which this rule grants access.

    • #83981

      Points: 4
      Rank: Member

      Thank You..

  • #83354

    Points: 1
    Rank: Member

    If you're asking just about that particular parameter on that particular cmdlet check out these links for info on powershell configuration files:

    If you're asking more generally about how to find that info from the provided help file, then that is definitely in there. So in the case of that parameter it is a string value so just about anything will be "accepted", i.e. any string value will pass parameter validation. That doesn't necessarily mean it's valid for the use case, but powershell accepts it and runs the command.

    In some cases you may have a parameter that is a string value but only accepts one of a handful of options. This is done through a "validateset" parameter option behind the scenes, but should show up in the help syntax as well. Check out this example of get-aduser:

        Gets one or more Active Directory users.
        Get-ADUser [-AuthType {Negotiate | Basic}] [-Credential ] [-Properties ] [-ResultPageSize
        ] [-ResultSetSize ] [-SearchBase ] [-SearchScope {Base | OneLevel | Subtree}] [-Server
        ] -Filter  []
        Get-ADUser [-Identity]  [-AuthType {Negotiate | Basic}] [-Credential ] [-Partition ]
        [-Properties ] [-Server ] []
        Get-ADUser [-AuthType {Negotiate | Basic}] [-Credential ] [-Properties ] [-ResultPageSize
        ] [-ResultSetSize ] [-SearchBase ] [-SearchScope {Base | OneLevel | Subtree}] [-Server
        ] -LDAPFilter  []

    Note in particular this part from the first parameter set:

    [-SearchScope {Base | OneLevel | Subtree}]

    That is the help file's way of telling you the choices available for that particular parameter. Anything other than one of those three options will throw an error. Also that error message usually has the acceptable options listed so that can be another way to find out the values.

The topic ‘How to know what all content is accepted by a parameter’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort