Created
January 9, 2019 12:31
-
-
Save pcrockett-pathway/8ce649e7ed8661ba2e1be923e0c68e82 to your computer and use it in GitHub Desktop.
Admin PowerShell Profile
This file contains hidden or 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
| $ErrorActionPreference = "Stop" | |
| <# | |
| .SYNOPSIS | |
| Will reset your colors to the scheme found in $PROFILE | |
| .DESCRIPTION | |
| Useful for when programs mess up your favorite console colors. WARNING: | |
| Will clear your screen. | |
| .EXAMPLE | |
| Initialize-Colors | |
| #> | |
| function Initialize-Colors { | |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version 5.0 | |
| [Console]::BackgroundColor = "Black" | |
| [Console]::ForegroundColor = "White" | |
| $Host.PrivateData.VerboseForegroundColor = "DarkGray" | |
| Clear-Host | |
| } | |
| Initialize-Colors | |
| $Lambda = "[$env:USERNAME]" | |
| function Prompt { | |
| if (Test-Path Variable:\PSDebugContext) { | |
| $debugPrefix = ' [DBG] ' | |
| } | |
| else { | |
| $debugPrefix = ' ' | |
| } | |
| Write-Host -ForegroundColor Green "$PWD " | |
| Write-Host -NoNewline -ForegroundColor Cyan $Lambda | |
| $debugPrefix | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment