Improve install-ssh-client.ps1 and install-ssh-server.ps1

This commit is contained in:
Markus Fleschutz 2021-09-06 14:53:38 +02:00
parent 37ade894a1
commit 637d50eaa8
2 changed files with 12 additions and 4 deletions

View File

@ -15,7 +15,11 @@
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
Add-WindowsCapability -Online -Name OpenSSH.Client*
if ($IsLinux) {
apt install openssh-client
} else {
Add-WindowsCapability -Online -Name OpenSSH.Client*
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ installed SSH client in $Elapsed sec"

View File

@ -15,9 +15,13 @@
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
Add-WindowsCapability -Online -Name OpenSSH.Server*
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
if ($IsLinux) {
apt install openssh-server
} else {
Add-WindowsCapability -Online -Name OpenSSH.Server*
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ installed SSH server in $Elapsed sec"