forked from kubernetes/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs to reflect newly support shells with autocompletions (kub…
…ernetes#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>
- Loading branch information
Showing
4 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
content/en/docs/tasks/tools/included/optional-kubectl-configs-pwsh.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
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
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