title: How to suppress sql query output and show only the number of rows
body: <p>I have the following powershell command which displays the number of rows in a sql table. This works but it also includes the header:</p>
  
  <pre>Invoke-Sqlcmd -ServerInstance "01-SQL1\INSTANCE22" -Database master -Query "select Count(*) from dbo.mytable"</pre>
  
  <p>The Output I get is:</p>
  
  <pre class="lang-none prettyprint-override"><code>Column1
  -------    
  2450 &lt;= This line is actually displayed under Column1 on a separate line. I just couldn't get it to display properly here.
  </code></pre>
  
  <p>The only output I need is to show me the row count if it's greater than X number of rows, otherwise print "Less than 5000 rows found." How do I do this?</p>