Try adding width in the end
Invoke-DbaQuery -sqlinstance $SQLServer -File "C:\shell\sqladmin.sql"| Out-File C:\shell\dmsDB_history2.txt -width 5000
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I was executing this Powershell command below to get DB backup history
$SQLServer = Get-Content -Path "C:\shell\cdms.txt"
Invoke-DbaQuery -sqlinstance $SQLServer -File "C:\shell\sqladmin.sql"| Out-File C:\shell\dmsDB_history2.txt
and this is the sql query
74679-backup-based-on-date-history-good.txt
and the results i get is as below
supposed to be 7 columns but I can see only three columns and then 3 dot as I highlighted in yellow in output notepad file.
Please advice me how get all 7 columns in output file
It must have this 7 column below
Try adding width in the end
Invoke-DbaQuery -sqlinstance $SQLServer -File "C:\shell\sqladmin.sql"| Out-File C:\shell\dmsDB_history2.txt -width 5000
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
Instead of using "Out-File" why not use a CSV?
Export-CSV C:\shell\dmsDB_history2.csv -NoTypeInfo