Skip to content

Instantly share code, notes, and snippets.

@alevyinroc
Last active May 18, 2018 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alevyinroc/3185d1b9bf219005509ff82f9b91bd33 to your computer and use it in GitHub Desktop.
Save alevyinroc/3185d1b9bf219005509ff82f9b91bd33 to your computer and use it in GitHub Desktop.
Get-Content TableList.txt | Foreach-Object {Get-DbaTable -ServerInstance MYSERVER -Database satellites -Table $PSItem | ForEach-Object {$PSItem.Columns | Select-Object Name,DataType,Nullable,@{name='Length';expression={$_.Properties["Length"].Value}} | Export-Excel -Path C:\Users\andy\Documents\TableInfo2.xlsx -WorkSheetname $PSItem.Name -FreezeTopRow -BoldTopRow}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment