Files
website/content/en/docs/tasks/tools/included/optional-kubectl-configs-pwsh.md
Zovin Khanmohammed c189c2d162 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>
2021-09-12 02:56:06 -07:00

810 B

title, description, headless
title description headless
PowerShell auto-completion Some optional configuration for powershell auto-completion. 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:

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:

kubectl completion powershell >> $PROFILE

After reloading your shell, kubectl autocompletion should be working.