Let's execute a PS script that is stored in a file that does not have .ps1
extension:
Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Get-Content path\script.txt)))
How can I store full STDOUT and STDERR outputs into one or two variable(s), with no output to screen?