Powershell - SQL Server - connectionstring in loop for multiple Instances
The return value of -1 makes sense when you consider what ExecuteNonQuery() does. It returns the number of rows affected or -1 in case of set nocount on or non-updating queries.

As per documentation,


  For UPDATE, INSERT, and DELETE statements, the return value is the
  number of rows affected by the command. ... For
  all other types of statements, the return value is -1. If a rollback
  occurs, the return value is also -1.


Try .ExecuteReader() instead.