Compare commits

...

3 Commits

Author SHA1 Message Date
DeveloperDurp
be11bac6f7
Merge a0e31b0954 into 28bea518f0 2024-12-29 11:48:31 +03:00
DeveloperDurp
28bea518f0
Add exception catch for Unauthorized Access (#3114) 2024-12-28 15:38:40 -06:00
DeveloperDurp
a0e31b0954 Move Installer for OpenSSH to a runspace 2024-12-19 06:11:46 -06:00
3 changed files with 20 additions and 1 deletions

View File

@ -47,6 +47,8 @@ function Set-WinUtilRegistry {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
} catch [System.Management.Automation.ItemNotFoundException] {
Write-Warning $psitem.Exception.ErrorRecord
} catch [System.UnauthorizedAccessException]{
Write-Warning $psitem.Exception.Message
} catch {
Write-Warning "Unable to set $Name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace

View File

@ -59,6 +59,6 @@ function Invoke-WPFButton {
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
"WPFWinUtilSSHServer" {Invoke-WinUtilSSHServer}
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
}
}

View File

@ -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 "======================================="
}
}