Considering the following dependencies:
$dependencies = @{
PSDependOptions = @{
Target = '.\Tmp'
AddToPath = $True
DependencyType = 'PSGalleryModule'
Parameters = @{
Repository = 'LOPublic'
}
}
PsDepend = @{
Version = 'latest'
Parameters = @{}
}
}
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.
Considering the following dependencies:
If you call
Get-Dependency -InputObject $dependenciesParsed dependency is:
As you can see, the whole hashtable is used as version field value. Indeed the
Parse-Dependencyfunction 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.