diff --git a/site/content/completions/powershell.md b/site/content/completions/powershell.md index 667e2e1..b6a312e 100644 --- a/site/content/completions/powershell.md +++ b/site/content/completions/powershell.md @@ -36,6 +36,20 @@ $ helm s[tab] search show status ``` +### Aliases + +You can also configure `powershell` aliases for your program, and they will also support completions. + +``` +$ sal aliasname origcommand +$ Register-ArgumentCompleter -CommandName 'aliasname' -ScriptBlock $__origcommandCompleterBlock +# and now when you run `aliasname` completion will make +# suggestions as it did for `origcommand`. +$ aliasname +completion firstcommand secondcommand +``` +The name of the completer block variable is of the form `$__CompleterBlock` where every `-` and `:` in the program name have been replaced with `_`, to respect powershell naming syntax. + ### Limitations * The following flag completion annotations are not supported and will be ignored for `powershell`: