2021-02-09 19:08:24 +00:00
|
|
|
if((Get-WindowsCapability -Online | ? Name -like OpenSSH.Server*).State -eq "Installed") {
|
|
|
|
Write-Output "OpenSSH Server is already installed."
|
|
|
|
} else {
|
|
|
|
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
|
|
|
|
Set-Service -Name sshd -StartupType 'Automatic'
|
|
|
|
Start-Service sshd
|
|
|
|
}
|
|
|
|
Get-WindowsCapability -Online | Where-Object -Property Name -Like "OpenSSH*"
|