Created
November 16, 2014 19:03
-
-
Save pcgeek86/152a5ef408f7a6436758 to your computer and use it in GitHub Desktop.
Document PowerShell Commands & Parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ParameterList = @(); | |
# Get a list of PowerShell commands | |
$CommandList = Get-Command -CommandType Cmdlet,Function -Module Azure; | |
foreach ($Command in $CommandList) { | |
foreach ($ParameterSet in $Command.ParameterSets) { | |
foreach ($Parameter in $ParameterSet.Parameters) { | |
$ParameterList += [PSCustomObject]@{ | |
Module = $Command.ModuleName; | |
CommandName = $Command.Name; | |
ParameterSetName = $ParameterSet.Name; | |
ParameterName = $Parameter.Name; | |
ParameterType = $Parameter.ParameterType; | |
}; | |
} | |
} | |
} | |
# Export all parameter details to a CSV file | |
$OutputPath= '{0}\ParameterList.csv' -f $PSScriptRoot; | |
$ParameterList | Export-Csv -Path $OutputPath -NoTypeInformation; | |
# Open the CSV file in Excel (or other default .csv program) | |
Invoke-Item -Path $OutputPath; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment