title: Powershell Import-Module SqlServer and SQLPS dont get along
body: <p>In a current Powershell session i am running the following commands</p>
  <pre><code>Import-Module SqlServer
  Import-Module SQLPS
  </code></pre>
  <p>The Import-Module Command for SqlServer works fine, but Import-Module command for SQLPS fails</p>
  <pre><code>PS C:\windows\system32&gt; Import-Module SqlServer
  PS C:\windows\system32&gt; Import-Module SQLPS
  Import-Module : The following error occurred while loading the extended type data file: Error in TypeData
  &quot;Microsoft.SqlServer.Management.Smo.NamedSmoObject&quot;: The member DefaultKeyPropertySet is already present.
  Error in TypeData &quot;Microsoft.SqlServer.Management.Smo.NamedSmoObject&quot;: The member DefaultDisplayPropertySet is already
  present.
  Error in TypeData &quot;Microsoft.SqlServer.Management.Smo.NamedSmoObject&quot;: The member DefaultDisplayProperty is already
  present.
  At line:1 char:1
  + Import-Module SQLPS
  + ~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
      + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
  </code></pre>
  <p>I have tried removing the SqlServer module using Remove-Module command but no luck. I have a script which is Importing the SqlServer module at the start and then there are certain tasks in the script for which the SQLPS module is being used (and it fails with the above error). I am guessing that these 2 modules cannot be loaded in the same powershell session.</p>