Skip to content

Instantly share code, notes, and snippets.

@pcgeek86
Created November 16, 2014 19:03
Show Gist options
  • Save pcgeek86/152a5ef408f7a6436758 to your computer and use it in GitHub Desktop.
Save pcgeek86/152a5ef408f7a6436758 to your computer and use it in GitHub Desktop.
Document PowerShell Commands & Parameters
$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