diff --git a/PSFramework/functions/utility/Disable-PSFConsoleInterrupt.ps1 b/PSFramework/functions/utility/Disable-PSFConsoleInterrupt.ps1 index 0c5af917..d6ca90cf 100644 --- a/PSFramework/functions/utility/Disable-PSFConsoleInterrupt.ps1 +++ b/PSFramework/functions/utility/Disable-PSFConsoleInterrupt.ps1 @@ -18,5 +18,5 @@ [CmdletBinding()] param () - [Console]::TreatControlCAsInput = $true -} \ No newline at end of file + try { [Console]::TreatControlCAsInput = $true } catch {} +} diff --git a/PSFramework/functions/utility/Enable-PSFConsoleInterrupt.ps1 b/PSFramework/functions/utility/Enable-PSFConsoleInterrupt.ps1 index df047987..43b82bf3 100644 --- a/PSFramework/functions/utility/Enable-PSFConsoleInterrupt.ps1 +++ b/PSFramework/functions/utility/Enable-PSFConsoleInterrupt.ps1 @@ -14,5 +14,5 @@ [CmdletBinding()] param () - [Console]::TreatControlCAsInput = $false -} \ No newline at end of file + try { [Console]::TreatControlCAsInput = $false } catch {} +}