RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
285 stars 76 forks source link

Output hash only parsed correctly for first module #18

Closed Plork closed 7 years ago

Plork commented 7 years ago

If you specify several "advanced" Powershell module syntaxes only the first is parsed correctly.

DependencyName : SecretServer
DependencyType : PSGalleryModule
Version        : 1.0.2
Tags           : prd
                 ota

DependencyName : f5-ltm
DependencyType : PSGalleryModule
Version        : {Version, Tags, Name, DependencyType...}
Tags           :

DependencyName : ProtectedData
DependencyType : PSGalleryModule
Version        : {Version, Tags, Name, DependencyType...}
Tags           :

Everything but the first is parsed as: "# It doesn't look like a git repo, and simple syntax: PSGalleryModule"

This is because $DependencyType gets set later on in the script as PSGalleryModule ($DependencyType = $DependencyHash.DependencyType) and therefore matches the following in Get-Dependency.ps1 at line 226

                if( $DependencyHash -is [string] -and
                    $Dependency -notmatch '/' -and
                    -not $DependencyType -or
                    $DependencyType -eq 'PSGalleryModule')
RamblingCookieMonster commented 7 years ago

This should be good to go! Thanks again for the heads up - hit me up if you run into any issues with it!