Currently Get-SqlTable does this:
foreach ($table in $database.Tables)
if ($table.IsSystemObject -eq $false -and ($table.name -like "*$name*" -or $name.Contains($table.name)))
#Return Table Object
...and will return an array of tables (if more than one exists).
This seems to me to run contrary to what one would expect in Powershell for a parameter called -name. Instead of this, how about adding a -pattern parameter that lets you get an arbitrary number of tables back, and changing the -name parameter to give you
the one table you specify (or $null, or toss an exception or whatever, if it doesn't exist)? It seems to me that this would be more consistent with how powershell parameters usually work.
Performance-wise, looping through all the tables is expensive if you don't need to do it (especially on pathologically large databases...like PeopleSoft ones with tens of thousands of tables).
Also, how about adding a -Schema parameter?
I can work around the current implementation by using Database.Tables.Item("name", "schema"), but I like to use SQLPSX :-)
Thanks for your consideration!