ImportExcel icon indicating copy to clipboard operation
ImportExcel copied to clipboard

Remove error columns

Open OwainEsau opened this issue 8 years ago • 0 comments

Hi, I'm not sure if this has been asked or not, sorry if it has and I missed it. I have read through the Get-Help section for export-excel multiple times now and cannot find a parameter that will remove this function.

Basically whenever I do pipe an Invoke-SQLCmd Results to Export-Excel like so:

$test3= Invoke-Sqlcmd -query $query3 -ServerInstance "."

$test2 | Export-Excel "C:\Users\owain\Table Mappings\test1.xlsx" -Autosize -FreezeTopRow -BoldTopRow -WorkSheetName TRISDocumentTypes

I end up with 5 extra columns in the sheet ( RowError, RowState, Table, ItemArray, HasErrors ), I just want to remove those columns.

OwainEsau avatar Oct 09 '18 02:10 OwainEsau