Test a .NET Connection via PowerShell - microsoft/CSS_SQL_Networking_Tools GitHub Wiki
Test a .NET Connection via PowerShell
See Determine If I Am Connected to SQL Server using Kerberos Authentication for a PowerShell script near the bottom of the topic.