Skip to content

Commit

Permalink
Add markdown file explaining support for PowerShell
Browse files Browse the repository at this point in the history
  • Loading branch information
frigus02 authored and spf13 committed Jun 7, 2019
1 parent 21ccc7b commit d658160
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions powershell_completions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generating PowerShell Completions For Your Own cobra.Command

Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles.

# What's supported

- Completion for subcommands using their `.Short` description
- Completion for non-hidden flags using their `.Name` and `.Shorthand`

# What's not yet supported

- Command aliases
- Required, filename or custom flags (they will work like normal flags)
- Custom completion scripts

0 comments on commit d658160

Please sign in to comment.