Skip to content

Instantly share code, notes, and snippets.

@asears
Created November 21, 2021 19:39
Show Gist options
  • Select an option

  • Save asears/ce6bcadaba7f7e341afea09162d8733f to your computer and use it in GitHub Desktop.

Select an option

Save asears/ce6bcadaba7f7e341afea09162d8733f to your computer and use it in GitHub Desktop.
Powershell profile dotnet autocomplete
# Path to profile
# Write-Output $PROFILE
# 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', $_)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment