Get-Content not work in the pipeline

@Bubariko Welcome to PowerShell.org forums.

Its probably due to empty lines in the text file. Make sure there are no empty lines and spaces on line endings when you have server names in a text file.

PS: You can format the code using the example in below link.