I have a psm1 which is called from a scheduled task that happens around midnight. At this point I’m still developing it and I just want to read everything that’s happening(getting backups, zipping things, moving things etc…)
Is there a way I can basically do what this pseudo code is saying?
First, you can do almost exactly that pseudo-code. But it depends on how the script is outputting its text. Anything done with Write-Host, no, you can’t redirect or capture. Write-AnhythingElse, yes. Write-Verbose, for example, provided you’ve enabled verbose output.