Skip to content

Commit 084b840

Browse files
authored
Merge pull request #31071 from shuaijinchao/zh/translate/optional-kubectl-configs-pwsh
[zh] translate optional-kubectl-configs-pwsh.md
2 parents cdeca91 + 4866812 commit 084b840

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "PowerShell 自动补全"
3+
description: "powershell 自动补全的一些可选配置。"
4+
headless: true
5+
---
6+
<!--
7+
---
8+
title: "PowerShell auto-completion"
9+
description: "Some optional configuration for powershell auto-completion."
10+
headless: true
11+
---
12+
-->
13+
14+
<!--
15+
The kubectl completion script for PowerShell can be generated with the command `kubectl completion powershell`.
16+
17+
To do so in all your shell sessions, add the following line to your `$PROFILE` file:
18+
-->
19+
使用命令 `kubectl completion powershell` 生成 PowerShell 的 kubectl 自动补全脚本。
20+
21+
如果需要自动补全在所有 shell 会话中生效,请将以下命令添加到 `$PROFILE` 文件中:
22+
23+
```powershell
24+
kubectl completion powershell | Out-String | Invoke-Expression
25+
```
26+
27+
<!--
28+
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.
29+
-->
30+
此命令将在每次 PowerShell 启动时重新生成自动补全脚本。你还可以将生成的自动补全脚本添加到 `$PROFILE` 文件中。
31+
32+
<!--
33+
To add the generated script to your `$PROFILE` file, run the following line in your powershell prompt:
34+
-->
35+
如果需要将自动补全脚本直接添加到 `$PROFILE` 文件中,请在 PowerShell 终端运行以下命令:
36+
37+
```powershell
38+
kubectl completion powershell >> $PROFILE
39+
```
40+
41+
<!--
42+
After reloading your shell, kubectl autocompletion should be working.
43+
-->
44+
完成上述操作后重启 shell,kubectl的自动补全就可以工作了。

0 commit comments

Comments
 (0)