Skip to content

Commit

Permalink
Adjusts formatting and Adds startup information
Browse files Browse the repository at this point in the history
  • Loading branch information
zikhan committed Aug 25, 2021
1 parent 152d2d6 commit 00f9042
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion staging/src/k8s.io/kubectl/pkg/cmd/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,17 @@ var (
kubectl completion fish > ~/.config/fish/completions/kubectl.fish`))

# Load the kubectl completion code for powershell into the current shell
kubectl completion powershell | Out-String | Invoke-Expression`))
kubectl completion powershell | Out-String | Invoke-Expression
# 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"
## Execute completion code in the profile
Add-Content $PROFILE "if (Get-Command kubectl -ErrorAction SilentlyContinue) {
kubectl completion powershell | Out-String | Invoke-Expression
}"
## Add completion code directly to the $PROFILE script
kubectl completion powershell >> $PROFILE`))
)
var (
Expand Down

0 comments on commit 00f9042

Please sign in to comment.