I have a PowerShell script that builds Fedora VMs in VirtualBox with no clicking. It also does AlmaLinux, Rocky, and CentOS Stream. After it kicks off an install it sits in a loop asking VirtualBox one question over and over: is this VM still running, or did it power off. The install is done when the guest powers itself off, so that answer is the whole exit condition.
The question goes through one small function, Get-VMState. It shells out to VBoxManage, reads back the machine-readable dump, and pulls the single line it cares about.
Here's the whole thing:
function Get-VMState {
param(






