Hello
Seem to be having a issue where the -ServerInstance parameter of the Invoke-Sqlcmd command does not like a variable I am passing it e.g. Invoke-Sqlcmd -ServerInstance $SQLInstance -Query "EXEC sp_helpsrvrolemember 'sysadmin'" however if I manually type the server instance e.g. SERVER\INSTANCE it works. When I print the variable out, it prints out exactly the same when I type it in manually e.g. SERVER\INSTANCE. I have tried making the variable a string variable, a PSObject etc but no luck. Anyone have any ideas?
Cheers
Charlie


