Unix SED command is very useful to make changes to a configuration file when you know what the default values are, below is a way to do a SED-like text change in PowerShell
(Get-Content c:\temp\test.txt).replace('[MYID]', 'MyValue') | Set-Content c:\temp\test.txt
Example: TeamCity Build Agent Configuration file needs updated so it knows where the server is.
$TeamCityConfPath = 'C:\TeamCity\buildAgent\conf\buildAgent.properties' (Get-Content $TeamCityConfPath).replace('serverUrl=http://localhost:8111/', 'serverUrl=http://someserver:1234/') | Set-Content $TeamCityConfPath (Get-Content $TeamCityConfPath).replace('name=Default Agent', 'name=TeamCityBA1') | Set-Content $TeamCityConfPath