I have a list of SQL Servers in a .csv file. Some of the SQL Servers are named instances and look like this. I need to strip the slash and everything after it. This snippet does that but I am not sure how to put it in a script:
The result is MySQLServer001$pos = “MySQLServer001\NamedInstance”.IndexOf("")
“MySQLServer001\NamedInstance”.substring(0,$pos)
Not sure where to go from here:
$startingFile = “c:\temp\myServers.csv”
$endingFile = “c:\temp\myServers_NoSlashes.csv”