After select position in a file , find the ligne with a string of my choice.

Welcome Forums General PowerShell Q&A After select position in a file , find the ligne with a string of my choice.

Viewing 6 reply threads
  • Author
    Posts
    • #236563
      Participant
      Topics: 9
      Replies: 54
      Points: 135
      Rank: Participant

      Hi all,

      I’m really stuck…and i think it’s easy to do…

      I have a file like this :

      It's the configuration of a schedule of a NetBackup strategy.
      We have the config of the Full schedule and the incremental schedule.

      i could have to select the Full or the Incr.
      The line of the configuration of Backup start time is "SCHEDWIN", i need to select this line

      I try something like that :

      Not working at all
      and this :

      But in the $SplitConf, there is just one line.

      So if the backup select is a full backup, how can i select the ligne SCHEDWIN ?
      Thx for help.

      • This topic was modified 3 months ago by Renaud.
    • #236575
      Participant
      Topics: 8
      Replies: 565
      Points: 2,157
      Helping Hand
      Rank: Community Hero

      Would this fulfill your need?

      or

      Output:

    • #236623
      Participant
      Topics: 9
      Replies: 54
      Points: 135
      Rank: Participant

      Hello Doug ^^

      That’s depend, sometimes i need the Full configuration, and sometimes the Incr Configuration.
      So the first variable is the type Full or Incr, after i need the SCHEDWIN below.

    • #236629
      Participant
      Topics: 9
      Replies: 54
      Points: 135
      Rank: Participant

      For explain this:
      I have done a script to modify schedule of Netbackup strategie, so the schedule incremental or Full.
      After i have modify it i want to rollback to the origin configuration, that i backup before any change on it.
      So when i select the rollBack the two things to know is the name of the policy and the type of schedule, Full or Incr 😉

    • #236632
      Participant
      Topics: 8
      Replies: 565
      Points: 2,157
      Helping Hand
      Rank: Community Hero

      Can you show examples of the output you desire?

    • #236635
      Participant
      Topics: 9
      Replies: 54
      Points: 135
      Rank: Participant

      When i have done a modify of a full Backup, to roll back i need the line :

      You must know the SCHEDWIN line could be at the 1 or 2 position after the line with the type of schedule, here “Full”

      • This reply was modified 3 months ago by Renaud.
      • This reply was modified 3 months ago by Renaud.
      • This reply was modified 3 months ago by Renaud.
    • #238391
      Participant
      Topics: 9
      Replies: 54
      Points: 135
      Rank: Participant

      Just for information, i have used the foreach variable :

      Example:

      Thx any way 😉

Viewing 6 reply threads
  • You must be logged in to reply to this topic.