PowerShell Command to Create a User DSN (for MS SQL)

 To create a user DSN:

Add-OdbcDsn -Name "Some_Inventory" -DriverName "ODBC Driver 17 for SQL Server" -DsnType "User" -Platform "64-bit" -SetPropertyValue @("Server=YOUR_SERVER,PORT", "Trusted_Connection=Yes", "Database=Some_Inventory")

Change the highlighted bits as per your environment.

To check/verify worked:

get-odbcdsn Some_Inventory

Comments