Enable .NET CLI Tab Completion
Below is a PowerShell snippet you can use to enable tab completion for the .NET CLI! Put this snippet into a PowerShell Profile, load it on startup and enable tab completion for your .NET commands.
# PowerShell parameter completion shim for the dotnet CLI
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
![This image shows the dotnet tab completion in action by highlighting '--version' and a list of other commands that can be selected.](http://images.ctfassets.net/7fbllf92k2sv/3nXgio8pk7LMnyjuLkb75n/d3e61bc7589f3dd925dcd105f8f53dcf/dotnet_tab_completion.png)
Reference
You can read more on How to enable TAB completion for the .NET CLI where they also give code snippets to enable tab completion across multiple shells.