mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Updated enable-ssh-client.ps1 and enable-ssh-server.ps1
This commit is contained in:
parent
d069b83cad
commit
8de3b7f559
@ -14,9 +14,12 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Add-WindowsCapability -Online -Name OpenSSH.Client*
|
||||
|
||||
write-host -foregroundColor green "OK - SSH client enabled"
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ enabled SSH client in $Elapsed sec"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -14,11 +14,14 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Add-WindowsCapability -Online -Name OpenSSH.Server*
|
||||
Start-Service sshd
|
||||
Set-Service -Name sshd -StartupType 'Automatic'
|
||||
|
||||
write-host -foregroundColor green "OK - SSH server enabled"
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed SSH server in $Elapsed sec"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user