Get-Content line by line

This topic contains 6 replies, has 3 voices, and was last updated by Profile photo of Bill M Bill M 2 weeks, 2 days ago.

  • Author
    Posts
  • #57983
    Profile photo of Bill M
    Bill M
    Participant

    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:
    cluster_name
    cluster_name2
    cluster_name3

  • #57986
    Profile photo of Olaf Soyk
    Olaf Soyk
    Participant

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

  • #57989
    Profile photo of Bill M
    Bill M
    Participant

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

  • #57994
    Profile photo of Wilfredo Perez
    Wilfredo Perez
    Participant

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

  • #57998
    Profile photo of Bill M
    Bill M
    Participant

    thanks, will request deletion

  • #58681
    Profile photo of Bill M
    Bill M
    Participant

    thank you

You must be logged in to reply to this topic.