I am trying to export the write-host output to text file, but it’s not happening, can someone please help
write-host “hello world” | out-file .\log.txt
In a script, I want to save all the results of write-host commands
.\test.ps1 3>&1 2>&1 4>&1 6>&1|Out-File .\log.txt
The above command is able to save only warnings, errors and verbose but not the result of write-host. Is there any way to save them ?