tools/Publish-Module.ps1
$manifest = Get-Content $PSScriptRoot\..\cbsch-pslib.psd1 -Raw -Encoding utf8 if ($manifest -match "ModuleVersion = '(.*)'") { $version = [Version]::new($matches[1]) $newVersion = "{0}.{1}.{2}" -f $version.Major,$version.Minor,(1 + [int]$version.Build) [Regex]::Replace($manifest, "ModuleVersion = '(.*)'", "ModuleVersion = '$newVersion'") | Set-Content -Path $PSScriptRoot\..\cbsch-pslib.psd1 -Encoding utf8 -NoNewline git add $PSScriptRoot\..\cbsch-pslib.psd1 git commit -m "Automatically bumped build number" } Publish-Module -Name $PSScriptRoot\..\cbsch-pslib.psd1 ` -NuGetApiKey (Get-StoredCredential PSPublishKey).GetNetworkCredential().Password |