Files
stevanfreeborn.results/scripts/update-version.ps1
T

16 lines
517 B
PowerShell

param(
[Parameter(Mandatory=$true)]
[string]$Version,
[string]$CsprojPath = "src/StevanFreeborn.Results/StevanFreeborn.Results.csproj"
)
$content = Get-Content $CsprojPath -Raw
if ($content -match "<Version>.*?</Version>") {
$content = $content -replace "<Version>.*?</Version>", "<Version>$Version</Version>"
} elseif ($content -match "<PropertyGroup>") {
$content = $content -replace "<PropertyGroup>", "<PropertyGroup>`n <Version>$Version</Version>"
}
Set-Content -Path $CsprojPath -Value $content