-
-
Save bielawb/a0179bc3a83c4866974797a823baa848 to your computer and use it in GitHub Desktop.
Same completer, but with parts of it abstracted - all New-*Completer need to be defined first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$commandName, | |
[string]$parameterName, | |
[string]$wordToComplete, | |
[System.Management.Automation.Language.CommandAst]$commandAst, | |
[System.Collections.IDictionary]$fakeBoundParameters | |
) | |
switch -Regex ($wordToComplete) { | |
'^(groupType|userAccountControl):$' { | |
New-MatchingRuleCompleter -Attribute $Matches[1] -Type AndOr | |
} | |
'^(member|memberof):$' { | |
New-MatchingRuleCompleter -Attribute $Matches[1] -Type Chain | |
} | |
'^(?!.*=)' { | |
New-AttributeCompleter -Pattern "$wordToComplete*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment