try { $null = gcm pshazz -ea stop; pshazz init } catch { } function PromptAdmin { $identity = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()) $isAdmin = $identity.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if ($isAdmin) { Write-Host "ADMIN " -NoNewline -ForegroundColor Red } } function PromptFolder { $currentFolder = $(Get-Item -Path "./") $isHome = $currentFolder.FullName -eq $HOME $folderName = if ($isHome) { "~" } else { $currentFolder.Name } $host.ui.RawUI.WindowTitle = $folderName Write-Host $folderName -NoNewline -ForegroundColor Cyan } function PromptGitBranch { $gitBranch = $(git rev-parse --abbrev-ref HEAD) if ($gitBranch) { Write-Host " git:(" -NoNewline -ForegroundColor Blue Write-Host $gitBranch -NoNewline -ForegroundColor DarkRed Write-Host ")" -NoNewline -ForegroundColor Blue $changedFiles = $(git status --porcelain) if ($changedFiles) { Write-Host " ✗" -NoNewline -ForegroundColor Yellow } } } function Prompt { if ($?) { Write-Host "➜ " -NoNewline -ForegroundColor Green } else { Write-Host "➜ " -NoNewline -ForegroundColor Red } PromptAdmin; PromptFolder; PromptGitBranch; return " " } Set-PSReadLineOption -EditMode Emacs Set-PSReadLineOption -Colors @{ Parameter="Green" Operator="White" InlinePrediction="DarkMagenta" } Set-Alias g git Set-Alias gw ./gradlew Set-Alias d dotnet Set-Alias l ls Set-Alias which Get-Command Set-Alias open Start-Process Set-Alias grep findstr function jk { npx jake $args } $env:GIT_SSH = $((Get-Command -Name ssh).Source) $env:DOTNET_CLI_TELEMETRY_OPTOUT = "1" $env:JEST_MAX_WORKERS = "8"