Skip to content

Commit 20987ac

Browse files
Update Enable-PSFConsoleInterrupt.ps1
prevent error: Exception setting "TreatControlCAsInput": "The handle is invalid."
1 parent 22b0070 commit 20987ac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

PSFramework/functions/utility/Enable-PSFConsoleInterrupt.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
[CmdletBinding()]
1515
param ()
1616

17-
[Console]::TreatControlCAsInput = $false
18-
}
17+
try { [Console]::TreatControlCAsInput = $false } catch {}
18+
}

0 commit comments

Comments
 (0)