Is it possible to implement the subcommand pattern in PowerShell? Something like:
command [subcommand] [options] [files]
Examples: Git, svn, Homebrew
What would be the general architecture? A single function that delegates the actual work to script blocks? Each subcommand isolated in its own PS1
file that is dot-sources by the primary script? Would PowerShell's various meta-data functions (e.g. Get-Command
) be able to 'inspect' the subcommands?