Tiny script… let me know if you know a better way.
function Get-Cmdlets {
param([System.Reflection.Assembly]$assembly)
$assembly.GetTypes() | Where-Object {
$_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false)
} | ForEach-Object {
$type = $_
$_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false)
} | Select VerbName, NounName, @{n="Type";e={$type}} |
}
## Example usage.
## You can use the [System.Reflection.Assembly]::Load... methods to get an assembly
## But for an example, use the "CallingAssembly" (System.Management.Automation )
Get-Cmdlets ([System.Reflection.Assembly]::GetCallingAssembly()) |
Sort VerbName, NounName | Format-Table -auto