June 9, 2022 at 11:02 am
I have a server list to include a few servers with a non-standard port.
individually:
invoke-sqlcmd -ServerInstance server01 ... is fine.
invoke-sqlcmd -ServerInstance "server\instance,1488" ... is fine.
invoke-sqlcmd -ServerInstance server\instance,1488 ... fails.
I need the quotes where I have to provide a non standard port.
But, I have a powershell that runs gc against a serverList, puts each server into $a then runs SQL against each server via invoke-sqlcmd.
I can't figure out how to pull from my serverList, and put the quotes around the server variables "server\instance,1488"
Please help. This is doing my head in!!
June 9, 2022 at 11:41 am
invoke... "$($servervariablefromlist)"
June 14, 2022 at 1:44 am
This was removed by the editor as SPAM
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply