Created
December 21, 2021 14:43
-
-
Save Eonasdan/fce300ce9ac646648ed6b48ba3e6f30e to your computer and use it in GitHub Desktop.
This powershell script can be used as an Azure DevOps task to take the build number and update appsettings or other json file as a version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$config = Get-Content "[path_to]\appsettings.json" -Raw|ConvertFrom-Json | |
Write-Host Current Server Version: $mainServerConfig.Version | |
$config.version = $Env:BUILD_BUILDNUMBER; | |
$config|ConvertTo-Json |Set-Content "[path_to]\appsettings.json" | |
Write-Host Updated Version: $Env:BUILD_BUILDNUMBER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment