Public/Get-CCNextVersion.ps1

function Get-CCNextVersion {
    <#
    .SYNOPSIS
        Computes the next version by incrementing Major, Minor, or Patch.
    .EXAMPLE
        Get-CCNextVersion -Path . -Part Minor
    #>

    [CmdletBinding()]
    [OutputType([pscustomobject])]
    param(
        [Parameter(Position = 0)]
        [string]$Path = '.',

        [Parameter(Mandatory)]
        [ValidateSet('Major', 'Minor', 'Patch')]
        [string]$Part
    )

    $full = (Resolve-Path -LiteralPath $Path).Path
    $partEnum = [CodeCompass.Core.Versioning.VersionPart]::$Part
    $result = [CodeCompass.Core.VersionService]::new().GetNextVersion($full, $partEnum)

    [pscustomobject]@{
        Current = $result.Current.ToString()
        Next    = $result.Next.ToString()
        Part    = $Part
    }
}