if (([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $bckgrnd = "DarkRed" $shellchar = "#" } else { $bckgrnd = "DarkBlue" $shellchar = "$" } $Host.UI.RawUI.BackgroundColor = $bckgrnd $Host.UI.RawUI.ForegroundColor = 'White' $Host.PrivateData.ErrorForegroundColor = 'Red' $Host.PrivateData.ErrorBackgroundColor = $bckgrnd $Host.PrivateData.WarningForegroundColor = 'Magenta' $Host.PrivateData.WarningBackgroundColor = $bckgrnd $Host.PrivateData.DebugForegroundColor = 'Yellow' $Host.PrivateData.DebugBackgroundColor = $bckgrnd $Host.PrivateData.VerboseForegroundColor = 'Green' $Host.PrivateData.VerboseBackgroundColor = $bckgrnd $Host.PrivateData.ProgressForegroundColor = 'Cyan' $Host.PrivateData.ProgressBackgroundColor = $bckgrnd Clear-Host Set-Alias sublime 'C:\Program Files\Sublime Text 3\sublime_text.exe' # Enable Modules Import-Module Posh-Git Import-Module 'C:\bin\oneget\OneGet.psd1' function prompt { $realLASTEXITCODE = $LASTEXITCODE if ($?) { $color = "Green" } else { $color = "Red" } $dir = $(pwd).path if ($dir.length -gt 30) { $dir = $(Split-Path -leaf -path (Get-Location)) } Write-Host ("[" + $(Get-Date -UFormat %H:%M) + "]") -nonewline -foregroundcolor Magenta Write-Host ("[" + $(@(Get-History).count) + "]") -nonewline -foregroundcolor Cyan Write-Host ("[" + $(@(get-job).count) + "]") -nonewline -foregroundcolor Yellow Write-Host ("[$Env:username@$Env:COMPUTERNAME]") -nonewline -foregroundcolor DarkCyan Write-VcsStatus # Posh-Git Invoke-Expression 'Write-Host ("`n[$dir] PS$shellchar") -nonewline -foregroundcolor $color' $global:LASTEXITCODE = $realLASTEXITCODE return " " } # Post-Git Enable-GitColors Pop-Location Start-SshAgent -Quiet