Public/Get-CCProjectVersion.ps1

function Get-CCProjectVersion {
    <#
    .SYNOPSIS
        Reads the current version of a project (PowerShell or .NET), auto-detecting the technology.
    .EXAMPLE
        Get-CCProjectVersion -Path .
    #>

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

    $full = (Resolve-Path -LiteralPath $Path).Path
    $reading = [CodeCompass.Core.VersionService]::new().GetVersion($full)

    [pscustomobject]@{
        Technology = $reading.Context.Technology.ToString()
        Version    = $reading.Version.ToString()
        Path       = $reading.Context.RootPath
    }
}