I am attempting to use an array of servers that i have in a sql query. But for that i need each server to be listed with single quotes.
Here is what i have:
$serverarray = @(server1, server2, server3)
for the query to work i need to build a query command file. I am doing this with:
$sqlcmd = “some long sting here including (‘server1’, ‘server2’, ‘server3’)”
$sqlcmd |out-file -encoding ascii -filepath $filepathvar
How can i get the servers to list with single ticks?