title: SQL Powershell Error: Invoke-Sqlcmd : The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet
body: <p>When I try to run a powershell script I get the following error:</p>
  
  <p>Invoke-Sqlcmd : The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program.</p>
  
  <p>So in Powershell I ran the following:</p>
  
  <pre><code>install-module sqlserver
  update-module sqlserver
  import-module sqlserver
  </code></pre>
  
  <p>This all runs fine. However when I rerun my script I still get the same error.</p>
  
  <p>I have also installed powershelltools.msi, downloaded as part of the SQL Server 2014 Feature pack here: <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=42295" rel="nofollow noreferrer">https://www.microsoft.com/en-gb/download/details.aspx?id=42295</a></p>
  
  <p>If I run this command:</p>
  
  <pre><code>Get-Command -Module sqlserver
  </code></pre>
  
  <p>I get this result:</p>
  
  <pre><code>CommandType     Name                                               Version    Source
  -----------     ----                                               -------    ------
  Alias           Decode-SqlName                                     21.0.17224 sqlserver
  Alias           Encode-SqlName                                     21.0.17224 sqlserver
  Function        SQLSERVER:                                         21.0.17224 sqlserver
  </code></pre>
  
  <p>Any ideas on what else I should try?</p>
  
  <p>I have SQLServer 2014 and Powershell Version 5</p>