I recently learn that since Windows 2000, we can use Data Link to check the database connectivity. It seems to be very neat trick.
Create the text file and rename to test.udl
Once it is created, you will see the icon changed.
configure the connection property
Double click the icon, we can configure the connection property
Alternatively , we can use notepad to edit the connection string directly .
I probably will just write the powershell script to do this but it is still pretty neat trick on windows.