title: PowerShell SqlModule corrupted
body: <p>I have installed <code>SqlServer</code> moduled with <code>Install-Module -Name SqlServer -Repository PSGallery -Verbose</code> command. PS says that it was successfuly.</p>
  
  <p>But when I'm runneng <code>import-module</code> I only see 3 items imported from this module:</p>
  
  <pre><code>PS &gt;import-module sqlserver -erroraction stop -verbose
  VERBOSE: Loading module from path 'C:\Program 
  Files\WindowsPowerShell\Modules\sqlserver\21.0.17240\sqlserver.psd1'.
  VERBOSE: Populating RepositorySourceLocation property for module sqlserver.
  VERBOSE: Loading module from path 'C:\Program 
  Files\WindowsPowerShell\Modules\sqlserver\21.0.17240\SqlServer.psm1'.
  VERBOSE: Exporting function 'SQLSERVER:'.
  VERBOSE: Exporting alias 'Encode-SqlName'.
  VERBOSE: Exporting alias 'Decode-SqlName'.
  VERBOSE: Importing function 'SQLSERVER:'.
  VERBOSE: Importing alias 'Decode-SqlName'.
  VERBOSE: Importing alias 'Encode-SqlName'.
  </code></pre>
  
  <p>Question: how to get all the commands (like <code>Invoike-Sqlcmd</code> and other) from <code>SqlServer</code> working?</p>
  
  <p>PS Version</p>
  
  <pre><code>Name                           Value                                                                                                                                                                                                 
  ----                           -----                                                                                                                                                                                                 
  PSVersion                      5.1.16299.251                                                                                                                                                                                         
  PSEdition                      Desktop                                                                                                                                                                                               
  PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                               
  BuildVersion                   10.0.16299.251                                                                                                                                                                                        
  CLRVersion                     4.0.30319.42000                                                                                                                                                                                       
  WSManStackVersion              3.0                                                                                                                                                                                                   
  PSRemotingProtocolVersion      2.3                                                                                                                                                                                                   
  SerializationVersion           1.1.0.1                                                                                                                                                                                               
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Running <code>Get-Command -Module SqlServer | Measure</code> gives even after force reinstall with <code>Install-Module SqlServer -Force</code>:</p>
  
  <pre><code>PS H:\&gt; Get-Command -Module SqlServer | Measure
  
  Count    : 3
  Average  :
  Sum      :
  Maximum  :
  Minimum  :
  Property :
  </code></pre>
  
  <p>Checked event log. Found bunch of <code>Information</code> records, when importing the <code>SqlServer</code> module like this:</p>
  
  <pre><code>Context Information: 
      DetailSequence=1
      DetailTotal=1
  
      SequenceNumber=17
  
      UserId=DOMAIN/User
      HostName=ConsoleHost
      HostVersion=5.1.16299.251
      HostId=GUID
      HostApplication=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      EngineVersion=5.1.16299.251
      RunspaceId=GUID
      PipelineId=6
      ScriptName=C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.0.17240\SqlServer.psm1
      CommandLine=        Add-Type -Path $binaryPath
  
  
  Details: 
  CommandInvocation(Add-Type): "Add-Type"
  ParameterBinding(Add-Type): name="Path"; value="C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.0.17240\Microsoft.SqlServer.Dmf.dll"
  </code></pre>