mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
NoUI mode and Concurrency edits (#4092)
* Autorun changes * Missed a handle * Remove todo --------- Co-authored-by: Chris Titus <dfm.titus@gmail.com>
This commit is contained in:
21
functions/public/Invoke-WPFUIThread.ps1
Normal file
21
functions/public/Invoke-WPFUIThread.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
function Invoke-WPFUIThread {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Creates and runs a task on Winutil's WPF Forms thread.
|
||||
|
||||
.PARAMETER ScriptBlock
|
||||
The scriptblock to invoke in the thread
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
$ScriptBlock
|
||||
)
|
||||
|
||||
if ($PARAM_NOUI) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sync.form.Dispatcher.Invoke([action]$ScriptBlock)
|
||||
}
|
||||
Reference in New Issue
Block a user