mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-06 06:38: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:
48
functions/public/Invoke-WinUtilAutoRun.ps1
Normal file
48
functions/public/Invoke-WinUtilAutoRun.ps1
Normal file
@@ -0,0 +1,48 @@
|
||||
function Invoke-WinUtilAutoRun {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Runs Install, Tweaks, and Features with optional UI invocation.
|
||||
#>
|
||||
|
||||
function BusyWait {
|
||||
Start-Sleep -Seconds 5
|
||||
while ($sync.ProcessRunning) {
|
||||
Start-Sleep -Seconds 5
|
||||
}
|
||||
}
|
||||
|
||||
BusyWait
|
||||
|
||||
Write-Host "Applying tweaks..."
|
||||
Invoke-WPFtweaksbutton
|
||||
BusyWait
|
||||
|
||||
Write-Host "Applying toggles..."
|
||||
$handle = Invoke-WPFRunspace -ScriptBlock {
|
||||
$Toggles = $sync.selectedToggles
|
||||
Write-Debug "Inside Number of toggles to process: $($Toggles.Count)"
|
||||
|
||||
$sync.ProcessRunning = $true
|
||||
|
||||
for ($i = 0; $i -lt $Tweaks.Count; $i++) {
|
||||
Invoke-WinUtilTweaks $Toggles[$i]
|
||||
}
|
||||
|
||||
$sync.ProcessRunning = $false
|
||||
Write-Host "================================="
|
||||
Write-Host "-- Toggles are Finished ---"
|
||||
Write-Host "================================="
|
||||
}
|
||||
BusyWait
|
||||
|
||||
Write-Host "Applying features..."
|
||||
Invoke-WPFFeatureInstall
|
||||
BusyWait
|
||||
|
||||
Write-Host "Installing applications..."
|
||||
Invoke-WPFInstall
|
||||
BusyWait
|
||||
|
||||
Write-Host "Done."
|
||||
}
|
||||
Reference in New Issue
Block a user