From fbe086dc8ffb91d89e8ff9acd5a6778276110c57 Mon Sep 17 00:00:00 2001 From: nanxiangLiu Date: Mon, 8 Apr 2024 12:08:02 +0800 Subject: [PATCH] fix oob pipeline --- build.proj | 8 +------- tools/PublishModules.ps1 | 2 +- tools/PublishModules.psm1 | 12 +++++++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/build.proj b/build.proj index 259304d01ff0..e4c93077cdd8 100644 --- a/build.proj +++ b/build.proj @@ -256,13 +256,7 @@ - - - - - - - + diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index 48b51ceb303a..5bb2f9d9421e 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -109,7 +109,7 @@ if ($PublishLocal) { $null = New-Item -ItemType Directory -Force -Path $tempRepoPath $tempRepoName = ([System.Guid]::NewGuid()).ToString() $repo = Get-PSRepository | Where-Object { $_.SourceLocation -eq $tempRepoPath } -if ($repo -ne $null) { +if ($null -ne $repo) { $tempRepoName = $repo.Name } else { Register-PSRepository -Name $tempRepoName -SourceLocation $tempRepoPath -PublishLocation $tempRepoPath -InstallationPolicy Trusted -PackageManagementProvider NuGet diff --git a/tools/PublishModules.psm1 b/tools/PublishModules.psm1 index 942ed4a2070c..60fc5da0b008 100644 --- a/tools/PublishModules.psm1 +++ b/tools/PublishModules.psm1 @@ -275,9 +275,8 @@ function Get-AllModules { ) Write-Host "Getting Azure client modules" $clientModules = Get-ClientModules -BuildConfig $BuildConfig -Scope $Scope -PublishLocal:$PublishLocal -IsNetCore:$isNetCore - Write-Host " " - - if($clientModules.Length -le 2 -and $TargetBuild -eq "true") { + Write-Host "$clientModules" + if($clientModules.Count -le 2 -and $TargetBuild -eq "true") { return @{ ClientModules = $clientModules } @@ -285,11 +284,11 @@ function Get-AllModules { Write-Host "Getting admin modules" $adminModules = Get-AdminModules -BuildConfig $BuildConfig -Scope $Scope - Write-Host " " + Write-Host "$adminModules" Write-Host "Getting rollup modules" $rollupModules = Get-RollupModules -BuildConfig $BuildConfig -Scope $Scope -IsNetCore:$isNetCore - Write-Host " " + Write-Host "$rollupModules" return @{ ClientModules = $clientModules; @@ -592,6 +591,9 @@ function Add-AllModules { foreach ($package in $packages) { $fileName = $package.Name $versionString = $fileName.Replace('Az.Accounts.', '').Replace('.nupkg', '') + if ($versionString -match 'preview') { + return + } $version = [version]$versionString if ($version -gt $latestVersion) {