當我在 Linux 上執行以下 PowerShell 腳本時:
dir
通過以下方式:
pwsh test.ps1 > output.txt
中的輸出output.txt限制為 80 列。
我怎樣才能防止這種行為?$host.UI.RawUI.BufferSizeLinux 不支持修改。
uj5u.com熱心網友回復:
我認為pwsh重定向輸出只會假設標準檔案寬度。
但是你可以在里面 設定一個寬度pwsh。
PS> .\test1.ps1 | Out-File z -Width 60
要么
pwsh -c ".\test1.ps1 | Out-File z -Width 60"
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/454881.html
標籤:电源外壳
上一篇:如何使用活動記錄存盤多個日期范圍
下一篇:在Linux上找不到PowerShell7.2.1New-PSSessionOptionOperationTimeout
