Powershell and some simple string manipulation
- by Pat
need some help with building a powershell script to help with some basic string manipulation. I know just enough powershell to get in trouble, but can't figure out the syntax or coding to make this work.
I have a text file that looks like this -
Here is your list of servers:
server1
server2.domain.local
server3
Total number of servers: 3
I need to take that text file and drop the first and last lines (Always first and last.) Then I need to take every other line and basically turn it into a CSV file.
The final output should be a text file that looks like this -
server1,server2.domain.local,server3
Any suggestions on where to start? Thanks!