I'm trying to replace line number 11 in a txt file using PowerShell.
Firstly I tried replacing a specific word, but it changed too much:
$output= (Resolve-DnsName -name name1).IPAddress
(Get-Content "C:\test\test.txt") -replace "IPADDRESS=","IPADDRESS=$output" | Set-Content C:\test\test.txt