powershell select-string -pattern crlf问题

时间:2013-09-03 14:29:21

标签: powershell

powershell是否有一个默认的行长度,它会在自动开始换行之前输出?我在输出文件中看到了额外的CRLF,它们不应该是(即输入文件是每行末尾带有crlf的csv文件,但在执行-pattern后,结果文件将每行分成多行和每行似乎是相同的最大尺寸)

1 个答案:

答案 0 :(得分:1)

从我的powershell个人资料(用适合你的东西取代500):

# Dynamically change the host buffer width because some cmdlets specifically
# rely on it and truncate information that exceeds the initial limit (80 characters).

if ($Host -and $Host.UI -and $Host.UI.RawUI) 
{
    $rawUI = $Host.UI.RawUI
    $oldSize = $rawUI.BufferSize
    $typeName = $oldSize.GetType().FullName
    $newSize = New-Object $typeName (500, $oldSize.Height)
    $rawUI.BufferSize = $newSize
}