@@ -218,9 +218,7 @@ function SetupPoshGit
218218 # Download and install posh-git
219219 Write-Host " Download and install post-git..."
220220 $pathToInstall = Split-Path - Path $mergePath - Parent
221-
222221 $currentFolder = $pwd
223-
224222 cd $pathToInstall
225223
226224 # Already exits?
@@ -238,23 +236,25 @@ function SetupPoshGit
238236 }
239237 .\install.ps1
240238
241- cd $currentFolder # back out
239+ cd $currentFolder
242240
243241 # Run when starting PowerShell
244- $text = @"
242+ $text = @"
245243
246244# Load Posh-git
247245Import-Module posh-sshell
248246
249247# Load SSH-agent with password
250- ssh-add $env: home \.ssh\id_rsa
251248Start-SshAgent -Quiet
252249"@
253250
254251 $text | out-file $global :PowerProfile - append
255252
256253 Write-Host " Install posh-sshell"
257254 PowerShellGet\Install-Module posh- sshell - Scope CurrentUser - Force
255+
256+ # Due to a bug (https://github.com/PowerShell/Win32-OpenSSH/issues/1234), run this command:
257+ sc.exe create sshd binPath= C:\Windows\System32\OpenSSH\ssh.exe
258258 }
259259 catch {
260260 Write-Host " While downloading and installing posh-git, something went wrong!" - Foreground Red
@@ -266,11 +266,12 @@ function DownloadGitconfigContent2
266266 # Colors for PowerShell
267267 $text = @"
268268
269- `$ Global:GitPromptSettings.BeforeIndex.ForegroundColor = [ConsoleColor]::Green
270- `$ Global:GitPromptSettings.IndexColor.ForegroundColor = [ConsoleColor]::Green
271- `$ Global:GitPromptSettings.WorkingColor.ForegroundColor = [ConsoleColor]::Red
272- `$ Global:GitPromptSettings.LocalWorkingStatusSymbol.ForegroundColor = [ConsoleColor]::Red
273- `$ Global:GitPromptSettings.LocalDefaultStatusSymbol.ForegroundColor = [ConsoleColor]::Red
269+ #Set readable colors
270+ `$ Global:GitPromptSettings.BeforeIndexForegroundColor = [ConsoleColor]::Green
271+ `$ Global:GitPromptSettings.IndexForegroundColor = [ConsoleColor]::Green
272+ `$ Global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::Red
273+ `$ Global:GitPromptSettings.LocalWorkingStatusForegroundColor = [ConsoleColor]::Red
274+ `$ Global:GitPromptSettings.LocalDefaultStatusForegroundColor = [ConsoleColor]::Red
274275
275276# Set start location
276277#Set-Location `$ env:home
0 commit comments