You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DiscordChatExporter/UpdateVersion.ps1

12 lines
621 B

param([string] $newVersion)
function Replace-TextInFile {
param([string] $filePath, [string] $pattern, [string] $replacement)
$content = [IO.File]::ReadAllText($filePath)
$content = [Text.RegularExpressions.Regex]::Replace($content, $pattern, $replacement)
[IO.File]::WriteAllText($filePath, $content, [Text.Encoding]::UTF8)
}
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Cli\DiscordChatExporter.Cli.csproj" '(?<=<Version>)(.*?)(?=</Version>)' $newVersion
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\DiscordChatExporter.Gui.csproj" '(?<=<Version>)(.*?)(?=</Version>)' $newVersion