Skip to main content
Post Closed as "Duplicate" by zett42, CommunityBot
added 6 characters in body
Source Link

Im trying to replace an ever-changing IP address in a text file. Here is the code I'm using.

$ConfigFile = "C:\Temp2\ConfigFile.xml"overrides"

$content = [System.IO.File]::ReadAllText($ConfigFile).Replace("10.0.0.333","127.0.0.1")
[System.IO.File]::WriteAllText($ConfigFile, $content) 

How do I make the 10.0.0.333 into a wildcard so it would work with any IP and change it back to the loopback address.

Im trying to replace an ever-changing IP address in a text file. Here is the code I'm using.

$ConfigFile = "C:\Temp2\ConfigFile.xml"

$content = [System.IO.File]::ReadAllText($ConfigFile).Replace("10.0.0.333","127.0.0.1")
[System.IO.File]::WriteAllText($ConfigFile, $content) 

How do I make the 10.0.0.333 into a wildcard so it would work with any IP and change it back to the loopback address.

Im trying to replace an ever-changing IP address in a text file. Here is the code I'm using.

$ConfigFile = "C:\Temp2\ConfigFile.overrides"

$content = [System.IO.File]::ReadAllText($ConfigFile).Replace("10.0.0.333","127.0.0.1")
[System.IO.File]::WriteAllText($ConfigFile, $content) 

How do I make the 10.0.0.333 into a wildcard so it would work with any IP and change it back to the loopback address.

Source Link

Replace IP in text file using PS

Im trying to replace an ever-changing IP address in a text file. Here is the code I'm using.

$ConfigFile = "C:\Temp2\ConfigFile.xml"

$content = [System.IO.File]::ReadAllText($ConfigFile).Replace("10.0.0.333","127.0.0.1")
[System.IO.File]::WriteAllText($ConfigFile, $content) 

How do I make the 10.0.0.333 into a wildcard so it would work with any IP and change it back to the loopback address.