if (-not $DataSet.Tables[0].Rows[0]) { ($DataSet.Tables[0].Columns | Select-Object -ExpandProperty ColumnName) -join ',' | Set-Content -Path "E:Users eerajdDocuments ethystrader-public-dev-generalsrcSQLMiscout.csv" }