嗨,我已经构建了一个运行良好的脚本,除了一件事,有时返回的字符串太长以至于它不适合 powershell 控制台,当我稍后将文本发送到 Richtextbox 时,我得到了所有...... . 最后而不是整个字符串
$username = "myaccount"
$sqlconnection = New-Object system.data.sqlclient.sqlconnection
$sqlconnection.ConnectionString ="server=myserver\sccm;database=sccm;trusted_connection=true;"
$sqlconnection.Open()
sqlcmd = New-Object system.data.sqlclient.sqlcommand
$sqlcmd = $sqlconnection.CreateCommand()
$sqlcmd.CommandText = "SELECT Info from SCCM.dbo.log WHERE Username = '$username'"
$sqlcmd.Connection = $sqlconnection
$data = New-Object system.data.sqlclient.sqldataadapter $sqlcmd
$dataset = New-Object system.data.dataset
$data.Fill($dataset)
$global:result = $dataset.Tables
我无法在任何地方指定 -Width 参数,所以我不知道如何获得结果的全长?