Max Trinidad shows how to use Powershell Core on Windows or Linux to run T-SQL queries:
There’s a catch!
Nothing is perfect yet! Using the .NET Core version of System.Data, there’s a known issue with the datarow class. It seems it’s building the data results as string list of values without the column information.
But, there’s always a way to make thing work adding some extra code to work around this issue and reconstruct the data the way we want.
Max points out a couple of issues that exist today, but they’re getting resolved.