<commit_before>param(
    [String] $majorMinor = "0.0",        # 2.0
    [String] $patch = "0",               # $env:APPVEYOR_BUILD_VERSION
    [String] $customLogger = "",         # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll
    [String] $nugetExecutable = "nuget", # teamcity
    [Switch] $notouch
)

function Set-AssemblyVersions($informational, $assembly)
{
    (Get-Content assets/CommonAssemblyInfo.cs) |
        ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } |
        ForEach-Object { $_ -replace """1.0.0""", """$informational""" } |
        ForEach-Object { $_ -replace """1.1.1.1""", """$($informational).0""" } |
        Set-Content assets/CommonAssemblyInfo.cs
}

function Install-NuGetPackages($solution)
{
    &($nugetExecutable) restore "$solution"
}

function Invoke-MSBuild($solution, $customLogger)
{
    if ($customLogger)
    {
        msbuild "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger"
    }
    else
    {
        msbuild "$solution" /verbosity:minimal /p:Configuration=Release
    }
}

function Invoke-NuGetPackProj($csproj)
{
    &($nugetExecutable) pack -Prop Configuration=Release -Symbols $csproj
}

function Invoke-NuGetPackSpec($nuspec, $version)
{
    &($nugetExecutable) pack $nuspec -Version $version -OutputDirectory .\ -Prop Configuration=Release -Symbols
}

function Invoke-NuGetPack($version)
{<commit_msg>make msbuild parameterizable<commit_after>param(
    [String] $majorMinor = "0.0",           # 2.0
    [String] $patch = "0",                  # $env:APPVEYOR_BUILD_VERSION
    [String] $customLogger = "",            # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll
    [String] $nugetExecutable = "nuget",    # teamcity
    [String] $msbuildExecutable = "msbuild" # teamcity
    [Switch] $notouch
)

function Set-AssemblyVersions($informational, $assembly)
{
    (Get-Content assets/CommonAssemblyInfo.cs) |
        ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } |
        ForEach-Object { $_ -replace """1.0.0""", """$informational""" } |
        ForEach-Object { $_ -replace """1.1.1.1""", """$($informational).0""" } |
        Set-Content assets/CommonAssemblyInfo.cs
}

function Install-NuGetPackages($solution)
{
    &($nugetExecutable) restore "$solution"
}

function Invoke-MSBuild($solution, $customLogger)
{
    if ($customLogger)
    {
        &($msbuildExecutable) "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger"
    }
    else
    {
        &($msbuildExecutable) "$solution" /verbosity:minimal /p:Configuration=Release
    }
}

function Invoke-NuGetPackProj($csproj)
{
    &($nugetExecutable) pack -Prop Configuration=Release -Symbols $csproj
}

function Invoke-NuGetPackSpec($nuspec, $version)
{
    &($nugetExecutable) pack $nuspec -Version $version -OutputDirectory .\ -Prop Configuration=Release -Symbols
}

function Invoke-NuGetPack($version)
{
{'fraction_non_alphanumeric': 0.16077498300475868, 'fraction_numerical': 0.011556764106050306, 'mean_word_length': 3.576982892690513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '841431', 'n_tokens_mistral': 1000, 'n_tokens_neox': 959, 'n_words': 166}