diff --git a/scripts/Setup-GitSsh.ps1 b/scripts/Setup-GitSsh.ps1 index 1f6b650..914361e 100644 --- a/scripts/Setup-GitSsh.ps1 +++ b/scripts/Setup-GitSsh.ps1 @@ -175,8 +175,8 @@ foreach ($hostAlias in ($parsed.Hosts.Keys | Sort-Object)) { } if (-not $WhatIf) { - Set-Content -LiteralPath $sshConfigPath -Value $configText.TrimEnd() -Encoding UTF8 -NoNewline - Add-Content -LiteralPath $sshConfigPath -Value '' -Encoding UTF8 + $utf8NoBom = New-Object System.Text.UTF8Encoding $false + [System.IO.File]::WriteAllText($sshConfigPath, $configText.TrimEnd() + "`n", $utf8NoBom) Get-Service ssh-agent -ErrorAction SilentlyContinue | Where-Object { $_.Status -ne 'Running' } | ForEach-Object { Start-Service ssh-agent -ErrorAction SilentlyContinue | Out-Null }