Setup-GitSsh: писать ssh config без UTF-8 BOM.

This commit is contained in:
2026-06-18 11:34:18 +10:00
parent 4caedb3074
commit e1078dc6ed
+2 -2
View File
@@ -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 }