命令行语法以防止在PowerShell输出文件中换行? [英] Commandline syntax to prevent wrapping in PowerShell output file?

查看:463
本文介绍了命令行语法以防止在PowerShell输出文件中换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下命令将输出包装到调用脚本的窗口的宽度。即,输出文件是 word包装的。如何防止在不修改脚本的情况下将其包装在输出文件中?

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


推荐答案

尝试一下(我无法测试

& '\\fileServer\c$\PowerShell Scripts\herScript.ps1' | out-string -width 4096 | out-file c:\output.txt

这篇关于命令行语法以防止在PowerShell输出文件中换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆