Store output of run command line to TSEnv with "RunAsUser".
Running a step as a user prevents you from using the TSEnvironment in order to store any data returned.
The step could be anything, like getting a byte array of a certificate, ad-groups of the computer or primary user or as in this example, getting the TPM OwnerAuth from MBAM.
I would rather store it directly in the TSEnv instead of in a temporary file and run another script to read the file just to be able to use the password, as a variable, from a “Run commandline”-step.
The only other workaround I’ve found this far is running the step the normal way and supply the credentials in the command line or within the script it executes.
Storing a pw, even if encrypted, in a package which every user has default access to isn’t optimal and using a password, in clear text, in a run command line step has security impacts as well.
Suggestion: Add the possibility to store the output/data returned from a "run command line"-step as a task sequence variable, even if runasuser is chosen. (see pic)

Updating status to noted. See https://docs.microsoft.com/en-us/sccm/core/understand/find-help#send-a-suggestion for an explanation of each value.