Get-Content line by line

How it is possible to read from a txt file line by line the names of clusters and then foreach cluster on each line to perform several tasks and displays the results in a format like “cluster_name” output ; “cluster2_name” output and so on. Clusters txt file looks like:

What did you try so far? If you have nothing yet you should take a look at Get-Content, Foreach and -Join.

I have a txt file with the name of the clusters and I want to get the hyper-v replica for each cluster

We don’t write scripts on request. You could hire a consultant or you search for prewritten helpful scripts here: Microsoft Technet Script Gallery

I agree with Olaf. There are tons of examples and scripts on the internet.

thanks, will request deletion

thank you