PowerShell auto-completion
Kubernetes Docs · نسخهٔ f284a9e7c87f · CC BY 4.0 برای مستندات و مجوزهای همراه
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-ExpressionThis 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 >> $PROFILEAfter reloading your shell, kubectl autocompletion should be working.