views:

11

answers:

0

I need to remove the headers and spacing from a SQL dataset in Powershell so i can compare the result.

Using $res = $DataSet.Tables[0].rows | ft -HideTableHeaders removes the headers but leaves the spacing.

What is the best way of just showing the result

prptySwitch
-----------
False

$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "Select prptySwitch FROM dbo.PrptyLogSwitch"
$SqlCmd.Connection = $con
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$DataSet.Tables[0]
$res = $DataSet.Tables[0].rows 

Thanks