Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0e23c0

Browse files
committed
fix local module loading while testing
1 parent bf55c5d commit b0e23c0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/UpdatePSModuleManifest.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ param
3232
[string] $ReleaseNotes
3333
)
3434

35+
$cleanVersion = $Version -replace '-.*$', ''
3536
Write-Output "Running $($MyInvocation.MyCommand.Name)"
3637
$psdFileContent = Get-Content -Path $ModulePath -Raw -ErrorAction Stop
3738
$updatePsdFile = $false
@@ -52,10 +53,10 @@ else {
5253

5354
# Update ModuleVersion
5455
$matchRegex = "(?<Front>ModuleVersion = ')(?<ModVersion>.+)(?<Back>')"
55-
$replaceMatch = '${Front}' + $Version + '${Back}'
56+
$replaceMatch = '${Front}' + $cleanVersion + '${Back}'
5657

57-
if(($psdFileContent -match $matchRegex) -and ($Matches['ModVersion'] -ne $Version)) {
58-
Write-Output "Updating ModuleVersion to: $Version"
58+
if(($psdFileContent -match $matchRegex) -and ($Matches['ModVersion'] -ne $cleanVersion)) {
59+
Write-Output "Updating ModuleVersion to: $cleanVersion"
5960
$psdFileContent = $psdFileContent -replace $matchRegex, $replaceMatch
6061
$updatePsdFile = $true
6162
}

0 commit comments

Comments
 (0)