Get-SolutionPath.psm1

<#
.Synopsis
   Automatic Version Tool (AVT)
.DESCRIPTION
  Get Solution Path
.EXAMPLE
   Get-SolutionPath project.sln
#>

function Get-SolutionPath
{
    [CmdletBinding()]
    [Alias()]
    [OutputType([hashtable])]
    Param
    (
        # Solution file (sln)
        [string]
        [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$false, HelpMessage="Solution file name")]
        $Solution
    )
    Begin
    {
    }
    Process
    {
        $path = Get-ChildItem -Path ..\ -Filter $Solution -Recurse |  Select-Object -First 1
        if ( $null -eq $path ){
            throw "Solution $Solution is not found!"
        }
        #
        $base = $path.Directory.Parent.FullName
        #
        $sln =  $path.FullName; 
        $relativeSln = [System.IO.Path]::Combine(".","src",$Solution);
        #
        $src = [System.IO.Path]::Combine($path.Directory.FullName)
        $relativeSrc = [System.IO.Path]::Combine(".","src");
        #
        $devops = [System.IO.Path]::Combine($path.Directory.Parent.FullName,"devops")
        if (-not (Test-Path -Path $devops -PathType Container)) {
            throw "Solution devops is not found!"
        }
        $relativeDevops = [System.IO.Path]::Combine(".","devops");
        #
        $output = [System.IO.Path]::Combine($devops,"publish")
        $relativeOutput = [System.IO.Path]::Combine($relativeDevops,"publish")
        #
        return @{
            Base = $base;
            Src = $src;
            RelativeSrc = $relativeSrc;
            Devops = $devops;
            RelativeDevops = $relativeDevops
            Sln = $sln; 
            RelativeSln = $relativeSln
            Output = $output;
            RelativeOutput = $relativeOutput
        }
    }
    End
    {
    }
}
Export-ModuleMember -Function Get-SolutionPath
# SIG # Begin signature block
# MIIIEwYJKoZIhvcNAQcCoIIIBDCCCAACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBqcRdRx3gQurp1
# 2ixTw9dF77eCOzKB/BupuOwKh/D/76CCBQ8wggULMIIC86AD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