lan*_*nce 12 powershell redirect command-line word-wrap windows-7
以下命令将输出包装到从中调用脚本的窗口的宽度.也就是说,输出文件是"word"包装的.如何在不修改脚本的情况下阻止输出文件中的这种包装?
PS C:\Users\User1> & '\\fileServer\c$\PowerShell Scripts\herScript.ps1' > output.txt
Run Code Online (Sandbox Code Playgroud)
CB.*_*CB. 11
试试这个(我无法测试)
& '\\fileServer\c$\PowerShell Scripts\herScript.ps1' | out-string -width 4096 | out-file c:\output.txt
Run Code Online (Sandbox Code Playgroud)