There’s not a way to redirect stdout from a process into a parameter directly. Instead you’d need to use a shell to redirect the whoami output into a file, and then fill the parameter by reading the file in relevance.
override wait
runas=currentuser
completion=job
hidden=true
wait cmd /c "whoami /upn > c:\temp\whoami.txt"
parameter "DomainEmail"="{line 1 of file "c:\temp\whoami.txt"}"
Of course you shouldn’t just assume “c:\temp”. The folder might not exist, the data might be tampered by another user on the machine, etc. Instead use the tip at Tip - Action Override User settings about finding a good per-user path for the active user… except another thread here recently highlighted that profile folder of user
does not work for AzureAD users, so…that maybe still needs some work, but do be careful about where you write the file (as the user) and where we read the file content (as LocalSystem)