PoshCode Logo PowerShell Code Repository

ListCmdletParameters by Sean Kearney 3 weeks ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/3188"></script>download | new post

Extract all Parameters for a cmdlet from GET-HELP, list them in a single column

  1. # To use
  2. # Save script as LISTPARAMETERS.PS1
  3. #
  4. # To get the parameters from a Powershell cmdlet just execute
  5. #
  6. # ./LISTPARAMETERS.PS1 -helpdata (GET-HELP GET-CHILDITEM)
  7. #
  8. # To list in a clean column, all of the parameters for GET-CHILDITEM
  9. #
  10. # ./LISTPARAMETERS.PS1 -helpdata (GET-HELP SET-QADUSER)
  11. #
  12. # To list in a clean column, all of the parameters for SET-QADUSER
  13. #
  14. # I find it handy for Cmdlets that have so many available parameters, it's hard to tell where to start
  15. #
  16. param($HelpData)
  17.  
  18. ($HelpData).Syntax | SELECT-OBJECT –ExpandProperty SyntaxItem | SELECT-OBJECT –ExpandProperty parameter | SELECT-OBJECT name

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me