Improve SMO objects with passed -Database
Improve SMO objects with passed -Database

When using SMO object as -ServerInstance parameter the -Database
parameter is ignored and the query runs on the SMO default database
context.
With this improvement, the database context will be change if the
-Database parameter was passed and if it is differente from the actual
context. (similar with what is done with -SQLConnection parameter)

This showed up using on Get-DbaDatabaseFile
Thanks to @RamblingCookieMonster for prove my finding :+1:

wsmelton/dbatools,SirCaptainMitch/dbatools,kozloski/dbatools,dsolodow/dbatools,alevyinroc/dbatools,sqlpadawan/dbatools,Splaxi/dbatools