Skip to content

Instantly share code, notes, and snippets.

@hugsy
Last active June 3, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugsy/dfb5e88eb0492ae193570a4daae80f9f to your computer and use it in GitHub Desktop.
Save hugsy/dfb5e88eb0492ae193570a4daae80f9f to your computer and use it in GitHub Desktop.
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
Set-PSReadlineOption -EditMode Emacs
Set-PSReadLineKeyHandler -Chord Ctrl+LeftArrow -Function BackwardWord
Set-PSReadLineKeyHandler -Chord Ctrl+RightArrow -Function NextWord
Function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item Env:$varName $varValue
}
}
Function Invoke-VisualStudio2019x64
{
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
}
Function Invoke-VisualStudio2019x86
{
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
}
Remove-Item alias:curl
Remove-Item alias:wget
New-Alias grep findstr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment