Hi,
When I type below command the new value is appended to the existing value;
(Get-Content C:\temp\File.ini) -replace ‘IP_1=*’, (‘IP_1=’+$ip) | Set-Content c:\temp\File.Ini
And when I add a period to the old character value ‘IP_1=.*’ the old value is replaced totally, wanted to know how does period work here?
-replace works with regular expressions. A period is the meta charachter for “any charachter” and the star/asterisk (*) is the modifier meaning 0 or any number of occurances of the charachter or meta charachter or group right before this meta charachter.