mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-30 09:14:59 +02:00
properly redirect sc.exe stderr to $null (#187)
Signed-off-by: Rui Lopes <rgl@ruilopes.com>
This commit is contained in:
parent
bb9e5b27f2
commit
da48ae4da0
@ -255,13 +255,13 @@ if (-not (Test-Path $sshdpath)) {
|
|||||||
if (Get-Service sshd -ErrorAction SilentlyContinue)
|
if (Get-Service sshd -ErrorAction SilentlyContinue)
|
||||||
{
|
{
|
||||||
Stop-Service sshd
|
Stop-Service sshd
|
||||||
sc.exe delete sshd 1> null
|
sc.exe delete sshd 1>$null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
|
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
|
||||||
{
|
{
|
||||||
Stop-Service ssh-agent
|
Stop-Service ssh-agent
|
||||||
sc.exe delete ssh-agent 1> null
|
sc.exe delete ssh-agent 1>$null
|
||||||
}
|
}
|
||||||
|
|
||||||
New-Service -Name ssh-agent -BinaryPathName $sshagentpath -Description "SSH Agent" -StartupType Manual | Out-Null
|
New-Service -Name ssh-agent -BinaryPathName $sshagentpath -Description "SSH Agent" -StartupType Manual | Out-Null
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
if (Get-Service sshd -ErrorAction SilentlyContinue)
|
if (Get-Service sshd -ErrorAction SilentlyContinue)
|
||||||
{
|
{
|
||||||
Stop-Service sshd
|
Stop-Service sshd
|
||||||
sc.exe delete sshd 1> null
|
sc.exe delete sshd 1>$null
|
||||||
Write-Host -ForegroundColor Green "sshd successfully uninstalled"
|
Write-Host -ForegroundColor Green "sshd successfully uninstalled"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -11,12 +11,9 @@ else {
|
|||||||
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
|
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
|
||||||
{
|
{
|
||||||
Stop-Service ssh-agent
|
Stop-Service ssh-agent
|
||||||
sc.exe delete ssh-agent 1>null
|
sc.exe delete ssh-agent 1>$null
|
||||||
Write-Host -ForegroundColor Green "ssh-agent successfully uninstalled"
|
Write-Host -ForegroundColor Green "ssh-agent successfully uninstalled"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host -ForegroundColor Yellow "ssh-agent service is not installed"
|
Write-Host -ForegroundColor Yellow "ssh-agent service is not installed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user