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!!
- This topic was modified 3 years, 3 months ago by snomadj.