@@ -4,7 +4,7 @@ function Set-NuSpecValues(
4
4
[parameter (Position = 1 , Mandatory = $true )][ValidateScript ({Test-Path $_ - PathType Leaf})][string ] $NuSpecFilePath ,
5
5
[parameter (Position = 2 , Mandatory = $true )][string ] $VersionNumber ,
6
6
[parameter (Position = 3 , Mandatory = $true )][string ] $IconUrl ,
7
- [parameter (Position = 4 )][string []] $Dependencies ,
7
+ [parameter (Position = 4 )][hashtable []] $Dependencies ,
8
8
[parameter (Position = 5 )][string []] $ReleaseNotes ) {
9
9
$XmlDocument = New-Object System.Xml.XmlDocument
10
10
$XmlDocument.Load ($NuSpecFilePath )
@@ -69,7 +69,7 @@ function Set-ElementValue(
69
69
function Set-Dependencies (
70
70
[System.Xml.XmlDocument ] $XmlDocument ,
71
71
[System.Xml.XmlElement ] $MetadataElement ,
72
- [string []] $Dependencies ) {
72
+ [hashtable []] $Dependencies ) {
73
73
if (-not $MetadataElement [" dependencies" ]){
74
74
$NewDependenciesElement = $XmlDocument.CreateElement (" dependencies" , $XmlDocument.DocumentElement.NamespaceURI )
75
75
$MetadataElement.AppendChild ($NewDependenciesElement )
@@ -79,7 +79,8 @@ function Set-Dependencies(
79
79
80
80
foreach ($Dependency in $Dependencies ){
81
81
$NewDependencyElement = $XmlDocument.CreateElement (" dependency" , $XmlDocument.DocumentElement.NamespaceURI )
82
- $NewDependencyElement.SetAttribute (" id" , $Dependency )
82
+ $NewDependencyElement.SetAttribute (" id" , $Dependency.ModuleName )
83
+ $NewDependencyElement.SetAttribute (" version" , $Dependency.ModuleVersion ?? $Dependency.RequiredVersion )
83
84
84
85
$MetadataElement [" dependencies" ].AppendChild($NewDependencyElement )
85
86
}
0 commit comments