Files
Mapo-IOB/SMGen/post-build.ps1
2023-07-24 16:31:43 +02:00

16 lines
600 B
PowerShell

param([string]$ProjectDir, [string]$ProjectPath);
$MainVers="..\Resources\MainVers.txt"
$FileVers="..\Resources\VersNum.txt"
$MajMin=Get-Content $MainVers
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum=$MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileVers -Value $currRelNum