Function Update-WinUtilProgramWinget { <# .DESCRIPTION This will update programs via Winget using a new powershell.exe instance to prevent the GUI from locking up. #> [ScriptBlock]$wingetinstall = { $host.ui.RawUI.WindowTitle = """Winget Install""" Start-Transcript $ENV:TEMP\winget-update.log -Append winget upgrade --all Pause } $global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru }