I am trying to write a powershell function where I pass my connection object.
Many of the SMO examples do not show how to use an established connection object.
Are there any good examples that allow the passing of the connection object?
Thanks in advance.
Taken from This Post. Read the post for more information.
You can define a function like below
Then can call it with a already constructed connection object like below
Call the function