MDT Task Sequence Hangs when using Terminal app

Task Sequence hangs (waits) installing an application until the mouse is clicked.

Adding the below PowerShell script to the start of the MDT deployment will force the client to use the old-school text window instead of the modern Windows Terminal app. It is often used by system builders to fix script errors or script frezzing.

Write-Host "Set the default terminal app to Console Host"
# This prevents scripts from unexpectedly aborting when/if the Terminal App gets updated while they are running. This may also prevent the rare, random problem of MDT Application installation PowerShell scripts not launching until mouse activity is detected.

New-Item -Path "HKCU:\Console" -Name "%%Startup" -ErrorAction Ignore | Out-Null

Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationConsole" -Value "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" -Type String

Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationTerminal" -Value "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" -Type String

Script source –
Task Sequence hangs (waits) installing an application until I move the mouse or click : r/MDT