mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-02 02:53:31 -05:00
fix splitting up in wpfrunspace & catch errors
This commit is contained in:
@ -22,13 +22,14 @@ function Invoke-WPFRunspace {
|
||||
Param (
|
||||
$ScriptBlock,
|
||||
$ArgumentList,
|
||||
$DebugPreference,
|
||||
$automation
|
||||
$DebugPreference
|
||||
)
|
||||
|
||||
if ($automation = $true) {
|
||||
if ($PARAM_RUN) {
|
||||
write-host "Running in Main Thread"
|
||||
& $ScriptBlock @ArgumentList @DebugPreference
|
||||
} else {
|
||||
write-host "Running in Runspace"
|
||||
# Create a PowerShell instance
|
||||
$script:powershell = [powershell]::Create()
|
||||
|
||||
|
Reference in New Issue
Block a user