From 9d6fd20ceb0b070fd880b156a95b8bea704c5b5e Mon Sep 17 00:00:00 2001 From: Tigger Kindel Date: Mon, 6 Nov 2023 06:30:08 -0700 Subject: [PATCH] fixing CI build --- Build.ps1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Build.ps1 b/Build.ps1 index fefd00e..9bf33a2 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -59,7 +59,8 @@ if ($localRepository) { ModuleName = $ocgvModule; ModuleVersion = $ocgvVersion } ) -ErrorAction Stop - # Ensure OCGV is installed and imported from local repo + + "Installing $ocgvModule v$ocgvVersion to ensure it is loaded from the local repo." Install-Module $ocgvModule -MinimumVersion $ocgvVersion -Force -Verbose -SkipPublisherCheck } } @@ -67,7 +68,7 @@ if ($localRepository) { if ($null -eq $ocgvVersion) { $module = (Find-Module $ocgvModule) | Select-Object -ExpandProperty Version | Sort-Object -Descending | Select-Object -First 1 $v = [Version]::new($module) - $ocgvVersion = "$($v.Major).$($v.Minor).$($v.Build)" + $ocgvVersion = "$($v.Major).$($v.Minor).$($v.Build).$($v.Revision)" "$ocgvModule v $ocgvVersion` found in PSGallery; Updating -RequiredModules in $PsdPath" Update-ModuleManifest -Path $PsdPath -RequiredModules @( @{ @@ -99,12 +100,13 @@ if ($localRepository) { Build-Module -SemVer $Version -OutputDirectory ".${ModulePath}" -SourcePath ./Source -ErrorAction Stop if ($localRepository) { - " Removing $ModuleName" + " Removing $ModuleName" Remove-Module $ModuleName -Force -ErrorAction SilentlyContinue - " Publishing $ModuleName to local repository at $localRepositoryPath" + " Publishing $ModuleName to local repository at $localRepositoryPath" Publish-Module -Path $ModulePath -Repository 'local' -ErrorAction Stop - " Installing $ModuleName to local repository at $localRepositoryPath" + " Installing $ModuleName to local repository at $localRepositoryPath" Install-Module -Name $ModuleName -Repository 'local' -Force -Verbose + " Importing $ModuleName" Import-Module $ModuleName -Force -Verbose "$ModuleName $(Get-Module $ModuleName | Select-Object -ExpandProperty Version) installed and imported." }