The following command wraps the output to the width of the window from which the script was called. That is, the output file is "word"-wrapped. How can I prevent this wrapping in the output file w/o modifying the script?
PS C:\Users\User1> & '\\fileServer\c$\PowerShell Scripts\herScript.ps1' > output.txt
Try this (I can't test it)
& '\\fileServer\c$\PowerShell Scripts\herScript.ps1' | out-string -width 4096 | out-file c:\output.txt