-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependency override is not handled correctly when DependencyType is set to PSGalleryModule in PSDependOptions #131
Comments
The problem is quite simple. elseif( $DependencyHash -is [string] -and
$Dependency -notmatch '/' -and
-not $DependencyType -or
$DependencyType -eq 'PSGalleryModule') This condition evaluates to elseif( $DependencyHash -is [string] -and
$Dependency -notmatch '/' -and
(-not $DependencyType -or $DependencyType -eq 'PSGalleryModule')) There are multiple places having this bug for different dependency types in the file. Actually I wanted to use this Package... I have not found any good alternatives to PSDepend. And I would like to submit a PR with the fix... But, it seems, the project is dead. The latest Package update on PSGallery was more than 1 year ago. And I'm not sure that new fixes will be available on PSGallery soon. |
Any thoughts on someone Publishing a new PSDepend module from a fork that is maintained? o.O |
Considering the following dependencies:
If you call
Get-Dependency -InputObject $dependencies
Parsed dependency is:
As you can see, the whole hashtable is used as version field value. Indeed the
Parse-Dependency
function in Get-Dependency.ps1 considers that when DependencyType is set to 'PSGalleryModule' in PSDependOptions, the dependency value is a string.A solution is to always take into account the type of the $Dependencyhash variable.
The text was updated successfully, but these errors were encountered: