February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Register-ArgumentCompleter command has two advantages over the ArgumentCompleter attribute. First, it can be used to set an argument-completer for a number of parameters across a number of commands at once. And second, it can create argument-completers for native commands; for example, when used as an alternative to the ArgumentCompleter attribute, the command is used as follows:
function Test-ArgumentCompleter { [CmdletBinding()] param ( [Parameter(Mandatory)] $Action )}$params = @{ CommandName = 'Test-ArgumentCompleter' ParameterName = 'Action' ScriptBlock = { param ( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter ) $possibleValues = 'Start', 'Stop', 'Create', 'Delete' ...Read now
Unlock full access