Last active
July 25, 2017 07:48
-
-
Save maksha/cff3de229c4a2df201af5ac1bbabbd91 to your computer and use it in GitHub Desktop.
Revisions
-
maksha revised this gist
Jul 25, 2017 . 1 changed file with 7 additions and 17 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,19 @@ # Import module posh-git Import-Module -Name posh-git # Setup awesome PS prompt function Test-Administrator { $user = [Security.Principal.WindowsIdentity]::GetCurrent(); (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) } # Chocolatey profile $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } function prompt { $realLASTEXITCODE = $LASTEXITCODE @@ -55,4 +45,4 @@ function prompt { Write-VcsStatus return "> " } -
maksha revised this gist
Dec 23, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -55,4 +55,4 @@ function prompt { Write-VcsStatus return "> " } -
maksha revised this gist
Nov 25, 2016 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,14 @@ # Run PowerShell as administrator: # 0. Set Execution Policy: # PS> Set-ExecutionPolicy RemoteSigned # # 1. Install PsGet (http://psget.net/): # PS> (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex # # 2. Install Posh-Git (https://github.com/dahlbyk/posh-git): # PS> Install-Module posh-git # As regular user # Import module posh-git Import-Module -Name posh-git @@ -7,7 +18,6 @@ if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } # Setup awesome PS prompt function Test-Administrator { $user = [Security.Principal.WindowsIdentity]::GetCurrent(); -
maksha created this gist
Nov 25, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ # Import module posh-git Import-Module -Name posh-git # Chocolatey profile $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } # Setup awesome PS prompt function Test-Administrator { $user = [Security.Principal.WindowsIdentity]::GetCurrent(); (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) } function prompt { $realLASTEXITCODE = $LASTEXITCODE Write-Host # Reset color, which can be messed up by Enable-GitColors $Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor if (Test-Administrator) { # Use different username if elevated Write-Host "(Elevated) " -NoNewline -ForegroundColor White } Write-Host " $ENV:USERNAME " -NoNewline -ForegroundColor White -BackgroundColor DarkGray if ($s -ne $null) { # color for PSSessions Write-Host " (`$s: " -NoNewline -ForegroundColor DarkGray Write-Host "$($s.Name)" -NoNewline -ForegroundColor Yellow Write-Host ") " -NoNewline -ForegroundColor DarkGray } Write-Host "" $($(Get-Location) -replace ($env:USERPROFILE).Replace('\','\\'), "~") "" -NoNewline -ForegroundColor Black -BackgroundColor Gray $global:LASTEXITCODE = $realLASTEXITCODE Write-Host Write-Host " " ($([char]0x2192)) " " -NoNewline -BackgroundColor DarkGray Write-VcsStatus return "> " }