1

I've been using Powershell with dbatools recently and still learning. When using format-table, I see it removes some columns from the result. It also does this when writing the result to a text file. I have tried format-table -autosize to no avail.

Code:

get-dbadbfile -SqlInstance instance | Format-Table -AutoSize

Any ideas?

Thanks

  • 1
    Does [this help](https://stackoverflow.com/questions/49122925/how-do-i-use-format-table-without-truncation-of-values)? `... |Format-Table -AutoSize |Out-File -Width 2147483647` – Mathias R. Jessen May 03 '21 at 19:11
  • 1
    There is not enough information in this question to properly answer/resolve this question There are several known issues that could be in play here. Missing: PowerShell version, Expected, Actual. See also [how to ask](https://stackoverflow.com/help/how-to-ask). How do you know that the column actually exists in the output in the first place? Does the column appear in `get-dbadbfile -SqlInstance instance | Export-Csv .\Test.csv`? If yes, add the `csv` output to the question together with the [mcve]: `Import-Csv .\Test.csv | Format-Table -AutoSize`. – iRon May 04 '21 at 06:38
  • Thanks - I know that the columns exist because when I run the command without the `format-table` option it returns all the columns. Anyway, this managed to sort it out for me. `get-dbadbfile -SqlInstance instance | Format-Table -Property * -AutoSize| Out-String -Width 4096` | out-file mylocation ` – Sicilian-Najdorf May 04 '21 at 09:11

0 Answers0