Don thanks for taking the time to answer my question, everything worked as you suggested. I think that I will leave the sqlps import where it is, otherwise remove-module MyModule will not remove sqlps as it will have been defined outside of the scope of the module. Or at least that is my understanding.
Thanks once again