Increment Value of CURRENT_VERSION in web configuration

bcmaningas's Avatar


09 Aug, 2017 12:14 PM

Hi -

Im trying to increase the Current_Version in our web config everytime I deploy using Octopus. Here is my script:

$webConfig = $OctopusParameters['Config_Path_Name']
$doc = (Get-Content $webConfig) -as [Xml]

##Update Current version
$date = Get-Date -Format yyyyMMdd
$version = $doc.configuration.appSettings.add | where {$_.key -eq 'CURRENT_VERSION'}
$version.value = $date + '_1'

##Save Changes

Can anyone help on how can I increase the '_1'?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac