title: Cannot find type [Microsoft.SqlServer.Management.Smo.Server] while running drop SQL DB in VSTS Powershell inline script task
body: <p>In my VSTS release when I run the following inline Powershell (Version 5.1) script </p>
  
  <pre><code>$srv = new-Object Microsoft.SqlServer.Management.Smo.Server(".") $db = New-Object Microsoft.SqlServer.Management.Smo.Database($srv, "MyDB") $db.Drop()
  </code></pre>
  
  <p>I get the following error</p>
  
  <p><code>##[error]new-Object : Cannot find type [Microsoft.SqlServer.Management.Smo.Server]: verify that the assembly containing this type is loaded.</code> </p>
  
  <p>From the above error, It is clear it can not find the 'SMO Server' and I have found some solutions how to add SMO server in windows environment but don't really know who to deal with that scenario in my VSTS Powershell VSTS task? As I am a newbie in Powershell world so not even sure if the script I am running is the right approach or if there is any other way of doing the job? I will appreciate if someone can help me with the inline script option rather the script file.</p>