A
A
Alghazanth2016-11-30 15:13:38
PowerShell
Alghazanth, 2016-11-30 15:13:38

How to find strings other than certain ones and replace a substring there by regexp in powershell?

There is a need to look for lines with an IP address in the configs and change them. There are lines that fall under the general IP address search regexp containing the substring 'Version=4.0.0.0', they cannot be touched. I tried to solve the problem like this: pasted.co/e81d82be
The final file does not include lines that contain the substring "Version ", although they should be there, you just don't need to change anything in them. How to handle this situation correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2016-11-30
@Alghazanth

described rather vaguely.
lay out examples of what is available at the beginning, what happens after the passage of your script and what should happen. This will make it easier to give specific advice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question