mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
* Autorun changes * Missed a handle * Remove todo --------- Co-authored-by: Chris Titus <dfm.titus@gmail.com>
22 lines
364 B
PowerShell
22 lines
364 B
PowerShell
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)
|
|
}
|