Skip to content

Instantly share code, notes, and snippets.

@gpduck
Created April 9, 2015 00:02
Show Gist options
  • Save gpduck/f64aaea6f3aa87a4049d to your computer and use it in GitHub Desktop.
Save gpduck/f64aaea6f3aa87a4049d to your computer and use it in GitHub Desktop.
Module Verb Coverage
$ModuleName = "YourModule"
$Verbs = Get-Command -Module $ModuleName | Select -Unique -ExpandProperty Verb | Sort
Get-Command -Module $ModuleName | Group Noun | %{
$Cmds = $_.Group
$Noun = $_.Name
$VerbCoverage = [Ordered]@{
Noun = $Noun
}
$Verbs | %{
$Verb = $_
$VerbCoverage.Add($Verb, ($Cmds.Verb -contains $Verb))
}
New-Object PSObject -Property $VerbCoverage
} | ft -auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment