Private/Get-ModuleManifest.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Function Get-ModuleManifest(){
    <#
    .SYNOPSIS
        Simple function to get Monifest file
    .NOTES
        Version: 1.0.0
        Author: Thomas ILLIET
        Creation Date: 21/07/2018
    #>

    Param(
        [Parameter(Mandatory=$True)]
        [String]$Name,

        [Parameter(Mandatory=$True)]
        [String]$Path
    )

    $ModulePath = Join-Path -Path $Path -ChildPath $Name
    $ModuleLastVersion = (Get-ChildItem $ModulePath | Sort-Object -Property Name -Descending)[0]
    $ModuleManifest = Join-Path -Path $ModuleLastVersion.FullName -ChildPath "$($Name).psd1"
    return $ModuleManifest

}