Files
winutil/functions/public/Invoke-WPFUIThread.ps1
T

22 lines
364 B
PowerShell
Raw Normal View History

2026-02-22 17:28:55 -06:00
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)
}