There are many ways of interacting with Microsoft SQL Server from within PowerShell. While there is the old SQLPS module as well as the new and improved SqlServer module, neither are fully compatible with PowerShell Core.
Instead, we can turn to .NET and to the much more convenient dbatools module from the community.