I'm still fairly new to PowerShell so I'm unsure of all the troubleshooting steps I can take to solve this problem. I would like to use the below command to determine if the replica is primary or not.
I believe I have successfully loaded both the provider and smo. Intellisense appears to recognize the command.
If I run the following command
The script will run but will never finish. I'm running it on one of the replicas so I'm assuming it should just be grabbing the local host. If I add the -WhatIf flag it still runs without finishing.
I've also tried Test-SqlAvailabilityGroup and it never finishes either.
What can I do to get this command to work? How do I find out what is causing it to lock up?
EDIT: It looks like my issue is with the path.... This path location works
but then I try using this path location and it fails.
Are we sure it's
at the end? I can set my location to
just fine. When I do a DIR to see what is available I see my two replicas listed as
So for the "MainReplica" part of the path do I replace that with FooNode1 or FooNode1\FooInstance?