Get-Content line by line

Welcome Forums General PowerShell Q&A Get-Content line by line

This topic contains 6 replies, has 3 voices, and was last updated by

 
Participant
1 year, 11 months ago.

  • Author
    Posts
  • #57983

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 9
    Rank: Member

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

  • #57989

    Participant
    Points: 0
    Rank: Member

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

  • #57994

    Participant
    Points: 0
    Rank: Member

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

  • #57998

    Participant
    Points: 0
    Rank: Member

    thanks, will request deletion

  • #58681

    Participant
    Points: 0
    Rank: Member

    thank you

The topic ‘Get-Content line by line’ is closed to new replies.