Update docs to reflect newly support shells with autocompletions (#29610)

* Update docs to reflect newly support shells with autocompletions

* Update Windows docs to use Powershell instead of zsh

* Adds a bit more explanation of the different lines.

* Apply suggestions from code review

Co-authored-by: Tim Bannister <tim@scalefactory.com>

* Apply PR suggestions

Co-authored-by: Tim Bannister <tim@scalefactory.com>
This commit is contained in:
Zovin Khanmohammed 2021-09-12 04:56:06 -05:00 committed by GitHub
parent 859880ab75
commit c189c2d162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 6 deletions

View File

@ -0,0 +1,23 @@
---
title: "PowerShell auto-completion"
description: "Some optional configuration for powershell auto-completion."
headless: true
---
The kubectl completion script for PowerShell can be generated with the command `kubectl completion powershell`.
To do so in all your shell sessions, add the following line to your `$PROFILE` file:
```powershell
kubectl completion powershell | Out-String | Invoke-Expression
```
This command will regenerate the auto-completion script on every PowerShell start up. You can also add the generated script directly to your `$PROFILE` file.
To add the generated script to your `$PROFILE` file, run the following line in your powershell prompt:
```powershell
kubectl completion powershell >> $PROFILE
```
After reloading your shell, kubectl autocompletion should be working.

View File

@ -176,7 +176,7 @@ kubectl version --client
### Enable shell autocompletion
kubectl provides autocompletion support for Bash and Zsh, which can save you a lot of typing.
kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell, which can save you a lot of typing.
Below are the procedures to set up autocompletion for Bash and Zsh.

View File

@ -159,7 +159,7 @@ If you are on macOS and using [Macports](https://macports.org/) package manager,
### Enable shell autocompletion
kubectl provides autocompletion support for Bash and Zsh, which can save you a lot of typing.
kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell which can save you a lot of typing.
Below are the procedures to set up autocompletion for Bash and Zsh.

View File

@ -22,7 +22,6 @@ The following methods exist for installing kubectl on Windows:
- [Install kubectl binary with curl on Windows](#install-kubectl-binary-with-curl-on-windows)
- [Install on Windows using Chocolatey or Scoop](#install-on-windows-using-chocolatey-or-scoop)
### Install kubectl binary with curl on Windows
1. Download the [latest release {{< param "fullversion" >}}](https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe).
@ -134,11 +133,11 @@ Edit the config file with a text editor of your choice, such as Notepad.
### Enable shell autocompletion
kubectl provides autocompletion support for Bash and Zsh, which can save you a lot of typing.
kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell, which can save you a lot of typing.
Below are the procedures to set up autocompletion for Zsh, if you are running that on Windows.
Below are the procedures to set up autocompletion for PowerShell.
{{< include "included/optional-kubectl-configs-zsh.md" >}}
{{< include "included/optional-kubectl-configs-pwsh.md" >}}
### Install `kubectl convert` plugin