I didn't found very detailed examples, then here is a PowerShell script that explains how to create, configure and start a VirtualBox Machine.
The goal is:
- Create a VM (OS type: FreeBSD_64)
- Configure it (with a serial port that redirect to a pipe)
- Convert a unzipped BSDRP-full-amd64-vga disk image file to a VDI file, and attach this VDI to the VM
- Start the VM
- Initialize the COM API
- Create the VM
- Configure the VM (excluding attaching medium to it)
- Save and register the VM
- Convert a RAW file to VDI (using VBoxManage.exe) and registering it
- Lock the VM in write mode for attaching the medium
- Launch the VM