mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 09:58:19 +02:00
Improve install-ssh-client.ps1 and install-ssh-server.ps1
This commit is contained in:
parent
37ade894a1
commit
637d50eaa8
@ -15,7 +15,11 @@
|
|||||||
try {
|
try {
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$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
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ installed SSH client in $Elapsed sec"
|
"✔️ installed SSH client in $Elapsed sec"
|
||||||
|
@ -15,9 +15,13 @@
|
|||||||
try {
|
try {
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
Add-WindowsCapability -Online -Name OpenSSH.Server*
|
if ($IsLinux) {
|
||||||
Start-Service sshd
|
apt install openssh-server
|
||||||
Set-Service -Name sshd -StartupType 'Automatic'
|
} else {
|
||||||
|
Add-WindowsCapability -Online -Name OpenSSH.Server*
|
||||||
|
Start-Service sshd
|
||||||
|
Set-Service -Name sshd -StartupType 'Automatic'
|
||||||
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ installed SSH server in $Elapsed sec"
|
"✔️ installed SSH server in $Elapsed sec"
|
||||||
|
Loading…
Reference in New Issue
Block a user