Fixed SQL Error
Fixed SQL Error

Also cleaned up code a bit and implemented messaging/flow control

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