Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Viewing all articles
Browse latest Browse all 122

Implement the subcommand pattern in PowerShell

$
0
0

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?


Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>