The PowerCli (VMWares powershell module) has a command: Connect-VIServer
You run Connect-VIServer -Server myserver -credentials (get-credentials)
After running that future powercli cmdlets in that session use that connection.
How do I do something like this with my own modules?
I want to have a command I could run like Connect-MyDB -Server mydb -Credentials (get-credentials)
How functions in my module access the server and $credentials variables when I run them in the session?