Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 57f85bf

Browse files
wooseung-simbmanikm
authored andcommitted
Fixed empty version tag for Nuget bug (#156) (#157)
Updated generate nuget tag code to do not provide version tag for empty or null versioning dependency modules/scripts
1 parent 90c5a3d commit 57f85bf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

PowerShellGet/PSModule.psm1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8536,7 +8536,14 @@ function Publish-PSArtifactUtility
85368536
$VersionString = "$($Dependency.MinimumVersion)"
85378537
}
85388538

8539-
$dependencies += "<dependency id='$($ModuleName)' version='$($VersionString)' />"
8539+
if ([System.string]::IsNullOrWhiteSpace($VersionString))
8540+
{
8541+
$dependencies += "<dependency id='$($ModuleName)'/>"
8542+
}
8543+
else
8544+
{
8545+
$dependencies += "<dependency id='$($ModuleName)' version='$($VersionString)' />"
8546+
}
85408547
}
85418548

85428549
# Populate the nuspec elements
@@ -15223,4 +15230,4 @@ Export-ModuleMember -Function Find-Module, `
1522315230
-Alias fimo, `
1522415231
inmo, `
1522515232
upmo, `
15226-
pumo
15233+
pumo

0 commit comments

Comments
 (0)