openalm / Extension-UtilitiesPack

Release Management utility tasks
Other
34 stars 38 forks source link

Allow search/replace option in json #26

Open jmichaud-ips opened 8 years ago

jmichaud-ips commented 8 years ago

An additional optional property in the JSON config could be added for a search string. If it exists, then only that search string gets replaced with the string specified in Value instead of the whole attribute. Valid values in ReplaceSearchString are anything the powershell -replace method can support, which includes regex. See below for example: { "KeyName": "/configuration/appSettings/add[@key='API_URL']", "Attribute":"value", "Value":":ApiPort", "ReplaceSearchString":":[0-9]+" }

harshil93 commented 8 years ago

Why would you want a part of the string to be replaced with the value. You can specify the whole value instead of partial value for replacement.

jmichaud-ips commented 8 years ago

I have a scenario with multiple WCF endpoints in a config. The first half is the base URL, which is always the same. The second half is a unique string per endpoint. I don't want to make a transform JSON for each endpoint (at least 6 of them).