diff --git a/build.psm1 b/build.psm1 index 3f66cc3020a..c3f11cd3713 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2250,6 +2250,9 @@ function Copy-PSGalleryModules # Remove the build revision from the src (nuget drops it). $srcVer = if ($version -match "(\d+.\d+.\d+).0") { $matches[1] + } elseif ($version -match "^\d+.\d+$") { + # Two digit versions are stored as three digit versions + "$version.0" } else { $version } @@ -2262,7 +2265,7 @@ function Copy-PSGalleryModules New-Item -Path $dest -ItemType Directory -Force -ErrorAction Stop > $null # Exclude files/folders that are not needed. The fullclr folder is coming from the PackageManagement module $dontCopy = '*.nupkg', '*.nupkg.metadata', '*.nupkg.sha512', '*.nuspec', 'System.Runtime.InteropServices.RuntimeInformation.dll', 'fullclr' - Copy-Item -Exclude $dontCopy -Recurse $src/* $dest + Copy-Item -Exclude $dontCopy -Recurse $src/* $dest -ErrorAction Stop } } diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index 680721738cf..8ce0d39f0ea 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -4,7 +4,7 @@ - +