I've used PowerShell in various VisualCron jobs, and I'm able to get output from them. Possibly a dumb question, but does your script actually display any output, or does it just do a bunch of processing?
For example, in one of my scripts I have a simple logging function:
function Write-Log {
param( $msg )
$LogTimestampFormat = "MMM dd, yyyy HH:mm:ss"
$LogTimestamp = (Get-Date -Format $LogTimestampFormat)
Write-Output "[$LogTimestamp] $msg"
}
And at various points within the script, I have a line like this:
Write-Log -msg "Start of log"
And when the script is done, the output that gets stored in VisualCron's Output variable would look something like this:
[Apr 23, 2020 11:09:44] Start of log
[Apr 23, 2020 11:09:44] Next line of log
[Apr 23, 2020 11:09:44] Another line of log
[Apr 23, 2020 11:09:44] End of log
Basically, VisualCron should be capturing anything that's written to the host as part of the PowerShell script.
I'm not sure about your foreground/background issue.