Created
December 9, 2019 16:57
-
-
Save trippwill/5bf0551998e89f5309254acb9a36ecf0 to your computer and use it in GitHub Desktop.
PowerShell Core Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Customize Prompt for Visual Studio Developer PowerShell | |
# Get the current prompt | |
$defaultPrompt = (Get-Item function:prompt).ScriptBlock | |
# Setup the custom prompt | |
function prompt { | |
$pr = if (Test-Path env:/VSINSTALLDIR) { "[VS $env:VisualStudioVersion]:" } | |
else {''} | |
Write-Host $pr -NoNewline -ForegroundColor DarkMagenta | |
Write-Host ' ' -NoNewline | |
$defaultPrompt.Invoke() | |
} | |
### Aliases | |
Set-Alias g git -Option AllScope -Scope Global | |
### dotnet | |
# 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