From a0e31b095408b5a9c27cf0f66664ba156c07a666 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Thu, 19 Dec 2024 06:11:46 -0600 Subject: [PATCH] Move Installer for OpenSSH to a runspace --- functions/public/Invoke-WPFButton.ps1 | 2 +- functions/public/Invoke-WPFSSHServer.ps1 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 functions/public/Invoke-WPFSSHServer.ps1 diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index ef581f1c..68cdfa28 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -59,6 +59,6 @@ function Invoke-WPFButton { "MicrowinScratchDirBT" {Invoke-ScratchDialog} "WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile} "WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile} - "WPFWinUtilSSHServer" {Invoke-WinUtilSSHServer} + "WPFWinUtilSSHServer" {Invoke-WPFSSHServer} } } diff --git a/functions/public/Invoke-WPFSSHServer.ps1 b/functions/public/Invoke-WPFSSHServer.ps1 new file mode 100644 index 00000000..503f8677 --- /dev/null +++ b/functions/public/Invoke-WPFSSHServer.ps1 @@ -0,0 +1,17 @@ +function Invoke-WPFSSHServer { + <# + + .SYNOPSIS + Invokes the OpenSSH Server install in a runspace + + #> + + Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock { + + Invoke-WinUtilSSHServer + + Write-Host "=======================================" + Write-Host "-- OpenSSH Server installed! ---" + Write-Host "=======================================" + } +}