I have got a script with some commands such as Write-Host \"Server1\". How can I export it to a file?
Write-Host \"Server1\"
When I tried with script > export.txt
script > export.txt
Using *> instead of > works for me. It redirects all output to a file; nothing is displayed on the screen.