diff --git a/.azure-pipelines/common-templates/install-tools.yml b/.azure-pipelines/common-templates/install-tools.yml index c1f65040840..8cd8f579cf3 100644 --- a/.azure-pipelines/common-templates/install-tools.yml +++ b/.azure-pipelines/common-templates/install-tools.yml @@ -27,11 +27,11 @@ steps: script: | Write-Output $PSVersionTable - - task: NodeTool@0 + - task: UseNode@1 displayName: Install NodeJs retryCountOnTaskFailure: 2 inputs: - versionSpec: 18.x + version: 22.x - task: PowerShell@2 displayName: Configure private npm feed @@ -93,7 +93,7 @@ steps: inputs: command: custom workingDir: $(Build.SourcesDirectory) - customCommand: install --no-package-lock @microsoft/rush + customCommand: install --no-package-lock @microsoft/rush@5.170.1 - task: PowerShell@2 displayName: Rush Build diff --git a/tools/GenerateModules.ps1 b/tools/GenerateModules.ps1 index a9db04f30bb..91e42e1a13a 100644 --- a/tools/GenerateModules.ps1 +++ b/tools/GenerateModules.ps1 @@ -65,7 +65,7 @@ if (-not ($RushInstalled -and $AutoRestInstalled)) { Write-Host "Node build tools not found at '$RepoRoot'. Installing rush and autorest..." Push-Location $RepoRoot try { - npm install --no-package-lock '@microsoft/rush' 'autorest@3.7.2' '@autorest/core@3.10.4' + npm install --no-package-lock '@microsoft/rush@5.170.1' 'autorest@3.7.2' '@autorest/core@3.10.4' if ($LASTEXITCODE -ne 0) { throw "Command 'npm install' for Node build tools (rush, autorest) failed with exit code $LASTEXITCODE." } @@ -159,8 +159,7 @@ $AutoRestTempFolder | ForEach-Object { } $Stopwatch = [system.diagnostics.stopwatch]::StartNew() -$CpuCount = (Get-CimInstance Win32_Processor | Measure-Object -Property NumberOfLogicalProcessors -Sum).Sum -$Throttle = [int][math]::Max(1, [math]::Min(4, $CpuCount / 2)) # Use half the CPU count but max 4, min 1 +$Throttle = 1 $Results = $ModuleToGenerate | ForEach-Object -Parallel { $Module = $_ Write-Host -ForegroundColor Green "-------------'Generating $Module'-------------"