mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-26 07:14:12 +00:00
docs: dot-source kubectl completion script in PowerShell profile
This commit is contained in:
@@ -103,7 +103,7 @@ var (
|
||||
# Set kubectl completion code for powershell to run on startup
|
||||
## Save completion code to a script and execute in the profile
|
||||
kubectl completion powershell > $HOME\.kube\completion.ps1
|
||||
Add-Content $PROFILE "$HOME\.kube\completion.ps1"
|
||||
Add-Content $PROFILE ". $HOME\.kube\completion.ps1"
|
||||
## Execute completion code in the profile
|
||||
Add-Content $PROFILE "if (Get-Command kubectl -ErrorAction SilentlyContinue) {
|
||||
kubectl completion powershell | Out-String | Invoke-Expression
|
||||
|
||||
Reference in New Issue
Block a user