You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call Get-Dependency -InputObject $dependencies
Parsed dependency is:
(...)
Name : PsDepend
Version : {Version, Parameters}
PSDependOptions : {AddToPath, DependencyType, Parameters, Target}
Raw :
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:
This condition evaluates to $true even when $DependencyHash is hashtableand$DependencyType is PSGalleryModule, because of not using parenthesis in complex conditions. The fix is quite simple also:
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.
That's really sad.
This condition evaluates to $true even when $DependencyHash is hashtableand$DependencyType is PSGalleryModule, because of not using parenthesis in complex conditions. The fix is quite simple also:
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. That's really sad.
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: