From f4e71fef454a760b72411d2741c9a736cc89859b Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Mon, 3 Mar 2025 15:25:41 -0600 Subject: [PATCH 01/12] Add tool to download modules from CFS and change download methods in pipeline to use the tool --- .pipelines/templates/checkAzureContainer.yml | 2 +- .pipelines/templates/compliance/apiscan.yml | 10 +------- .../templates/compliance/generateNotice.yml | 11 +-------- .../templates/release-MakeBlobPublic.yml | 4 ++-- .pipelines/templates/release-create-msix.yml | 2 +- .../templates/release-upload-buildinfo.yml | 2 +- .../release-validate-packagenames.yml | 2 +- .pipelines/templates/uploadToAzure.yml | 2 +- tools/installPSResources.ps1 | 24 +++++++++++++++++++ 9 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 tools/installPSResources.ps1 diff --git a/.pipelines/templates/checkAzureContainer.yml b/.pipelines/templates/checkAzureContainer.yml index a5ce2b1c666..f34d9fcfcc2 100644 --- a/.pipelines/templates/checkAzureContainer.yml +++ b/.pipelines/templates/checkAzureContainer.yml @@ -58,7 +58,7 @@ jobs: targetType: 'inline' script: | Get-PackageProvider -Name NuGet -ForceBootstrap - Install-Module -Name Az.Storage -Verbose -Force -AllowClobber + ./tools/installPSResource.ps1 -PSRepository CFS Uninstall-AzureRm -Verbose - task: AzurePowerShell@5 diff --git a/.pipelines/templates/compliance/apiscan.yml b/.pipelines/templates/compliance/apiscan.yml index bfe97827801..d868d0bacd7 100644 --- a/.pipelines/templates/compliance/apiscan.yml +++ b/.pipelines/templates/compliance/apiscan.yml @@ -79,15 +79,7 @@ jobs: retryCountOnTaskFailure: 2 - pwsh: | - $modules = 'Az.Accounts', 'Az.Storage' - foreach($module in $modules) { - if(!(get-module $module -listavailable)) { - Write-Verbose "installing $module..." -verbose - Install-Module $module -force -AllowClobber - } else { - Write-Verbose "$module already installed." -verbose - } - } + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Install PowerShell modules workingDirectory: '$(repoRoot)' diff --git a/.pipelines/templates/compliance/generateNotice.yml b/.pipelines/templates/compliance/generateNotice.yml index 9a00ed6f01d..c04b6afcf61 100644 --- a/.pipelines/templates/compliance/generateNotice.yml +++ b/.pipelines/templates/compliance/generateNotice.yml @@ -96,16 +96,7 @@ jobs: displayName: Initalize PowerShellGet - powershell: | - $modules = 'Az.Accounts', 'Az.Storage' - foreach($module in $modules) { - if(!(get-module $module -listavailable)) { - Write-Verbose "installing $module..." -verbose - Install-Module $module -force -AllowClobber - } else { - Write-Verbose "$module already installed." -verbose - #Update-Module $module -verbose - } - } + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Install PowerShell modules - powershell: | diff --git a/.pipelines/templates/release-MakeBlobPublic.yml b/.pipelines/templates/release-MakeBlobPublic.yml index 9472fa7cda9..92f9b9f7c3a 100644 --- a/.pipelines/templates/release-MakeBlobPublic.yml +++ b/.pipelines/templates/release-MakeBlobPublic.yml @@ -59,7 +59,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules - task: AzurePowerShell@5 @@ -157,7 +157,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules - task: AzurePowerShell@5 diff --git a/.pipelines/templates/release-create-msix.yml b/.pipelines/templates/release-create-msix.yml index cdb86544baf..fff045138b5 100644 --- a/.pipelines/templates/release-create-msix.yml +++ b/.pipelines/templates/release-create-msix.yml @@ -36,7 +36,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules and install Az.Storage diff --git a/.pipelines/templates/release-upload-buildinfo.yml b/.pipelines/templates/release-upload-buildinfo.yml index 27af6c87b64..e8373c2a899 100644 --- a/.pipelines/templates/release-upload-buildinfo.yml +++ b/.pipelines/templates/release-upload-buildinfo.yml @@ -112,7 +112,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules - task: AzurePowerShell@5 diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index df467eacc28..3a4a455a8cd 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -36,7 +36,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules and install Az.Storage diff --git a/.pipelines/templates/uploadToAzure.yml b/.pipelines/templates/uploadToAzure.yml index 9ac4671848b..7b4eda8d7ae 100644 --- a/.pipelines/templates/uploadToAzure.yml +++ b/.pipelines/templates/uploadToAzure.yml @@ -264,7 +264,7 @@ jobs: Write-Host 'AzureRM module removed' } - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS -Verbose displayName: Remove AzRM modules diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 new file mode 100644 index 00000000000..62cde0e0895 --- /dev/null +++ b/tools/installPSResources.ps1 @@ -0,0 +1,24 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +param( + [ValidateSet("PSGallery", "CFS")] + [string]$PSRepository = "PSGallery" +) + +if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) { + Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" +} + +# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to +# request an exact version. Otherwise, if a newer version is available in the +# upstream feed, it will fail to install any version at all. +Install-PSResource -Verbose -TrustRepository -RequiredResource @{ + "Az.Accounts" = @{ + version = "4.0.2" + repository = $PSRepository + } + "Az.Storage" = @{ + version = "8.1.0" + repository = $PSRepository + } +} From a062dce6561cc3e9ecc986041cce3fae09c2dfa1 Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Mon, 3 Mar 2025 18:40:22 -0600 Subject: [PATCH 02/12] Fix Andy's suggestions --- .pipelines/templates/checkAzureContainer.yml | 1 - .pipelines/templates/compliance/apiscan.yml | 3 +-- .pipelines/templates/compliance/generateNotice.yml | 3 +-- tools/installPSResources.ps1 | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.pipelines/templates/checkAzureContainer.yml b/.pipelines/templates/checkAzureContainer.yml index f34d9fcfcc2..f8aafc58c3a 100644 --- a/.pipelines/templates/checkAzureContainer.yml +++ b/.pipelines/templates/checkAzureContainer.yml @@ -57,7 +57,6 @@ jobs: inputs: targetType: 'inline' script: | - Get-PackageProvider -Name NuGet -ForceBootstrap ./tools/installPSResource.ps1 -PSRepository CFS Uninstall-AzureRm -Verbose diff --git a/.pipelines/templates/compliance/apiscan.yml b/.pipelines/templates/compliance/apiscan.yml index d868d0bacd7..dd5fff8aa2d 100644 --- a/.pipelines/templates/compliance/apiscan.yml +++ b/.pipelines/templates/compliance/apiscan.yml @@ -78,8 +78,7 @@ jobs: workingDirectory: '$(repoRoot)' retryCountOnTaskFailure: 2 - - pwsh: | - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + - pwsh: ./tools/installPSResource.ps1 -PSRepository CFS displayName: Install PowerShell modules workingDirectory: '$(repoRoot)' diff --git a/.pipelines/templates/compliance/generateNotice.yml b/.pipelines/templates/compliance/generateNotice.yml index c04b6afcf61..1cf540b87a8 100644 --- a/.pipelines/templates/compliance/generateNotice.yml +++ b/.pipelines/templates/compliance/generateNotice.yml @@ -95,8 +95,7 @@ jobs: Get-PackageProvider -Name NuGet -ForceBootstrap displayName: Initalize PowerShellGet - - powershell: | - ./tools/installPSResource.ps1 -PSRepository CFS + - pwsh: ./tools/installPSResource.ps1 -PSRepository CFS displayName: Install PowerShell modules - powershell: | diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 index 62cde0e0895..4ab1a9dc4bb 100644 --- a/tools/installPSResources.ps1 +++ b/tools/installPSResources.ps1 @@ -16,7 +16,7 @@ Install-PSResource -Verbose -TrustRepository -RequiredResource @{ "Az.Accounts" = @{ version = "4.0.2" repository = $PSRepository - } + } "Az.Storage" = @{ version = "8.1.0" repository = $PSRepository From ad0fe0f5e7557290111cc4edf6b33fb5b751cdbd Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Tue, 4 Mar 2025 10:18:23 -0600 Subject: [PATCH 03/12] Update binary pipeline to new name --- .pipelines/PowerShell-Packages-Official.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/PowerShell-Packages-Official.yml b/.pipelines/PowerShell-Packages-Official.yml index 7fce394ca19..13fc4cf54be 100644 --- a/.pipelines/PowerShell-Packages-Official.yml +++ b/.pipelines/PowerShell-Packages-Official.yml @@ -64,7 +64,7 @@ variables: resources: pipelines: - pipeline: CoOrdinatedBuildPipeline - source: 'PowerShell-Coordinated Packages-Official' + source: 'PowerShell-Coordinated Binaries-Official' trigger: branches: include: From ff1879c82a0e0a0277927d801b00d7b99ddd0605 Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:28:18 -0600 Subject: [PATCH 04/12] Update .pipelines/templates/release-MakeBlobPublic.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/release-MakeBlobPublic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/release-MakeBlobPublic.yml b/.pipelines/templates/release-MakeBlobPublic.yml index 92f9b9f7c3a..fe45b2ab455 100644 --- a/.pipelines/templates/release-MakeBlobPublic.yml +++ b/.pipelines/templates/release-MakeBlobPublic.yml @@ -59,7 +59,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules - task: AzurePowerShell@5 From 90c47928ed9bf912dcd6bed9da97bbcac1f1f6c7 Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:28:31 -0600 Subject: [PATCH 05/12] Update .pipelines/templates/uploadToAzure.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/uploadToAzure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/uploadToAzure.yml b/.pipelines/templates/uploadToAzure.yml index 7b4eda8d7ae..e9d6ea22339 100644 --- a/.pipelines/templates/uploadToAzure.yml +++ b/.pipelines/templates/uploadToAzure.yml @@ -264,7 +264,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules From c9e72b9b99d9e9fd92a5af6d17098cb5f43644da Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:28:46 -0600 Subject: [PATCH 06/12] Update .pipelines/templates/release-validate-packagenames.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/release-validate-packagenames.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index 3a4a455a8cd..e410b7bf025 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -36,7 +36,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules and install Az.Storage From 07efcff1436801ccc2b110e49fd6c4668ed51018 Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:31:46 -0600 Subject: [PATCH 07/12] Update .pipelines/templates/release-MakeBlobPublic.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/release-MakeBlobPublic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/release-MakeBlobPublic.yml b/.pipelines/templates/release-MakeBlobPublic.yml index fe45b2ab455..707ec8e55dd 100644 --- a/.pipelines/templates/release-MakeBlobPublic.yml +++ b/.pipelines/templates/release-MakeBlobPublic.yml @@ -157,7 +157,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules - task: AzurePowerShell@5 From 6560bb13c71dee39b3f7df07152b94cf67c5ef94 Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:32:20 -0600 Subject: [PATCH 08/12] Update .pipelines/templates/release-create-msix.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/release-create-msix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/release-create-msix.yml b/.pipelines/templates/release-create-msix.yml index fff045138b5..d8cf1453719 100644 --- a/.pipelines/templates/release-create-msix.yml +++ b/.pipelines/templates/release-create-msix.yml @@ -36,7 +36,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules and install Az.Storage From 10084c72b6b9c846e61e3357f32351a0f6c95a3c Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:32:33 -0600 Subject: [PATCH 09/12] Update .pipelines/templates/release-upload-buildinfo.yml Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> --- .pipelines/templates/release-upload-buildinfo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/release-upload-buildinfo.yml b/.pipelines/templates/release-upload-buildinfo.yml index e8373c2a899..af7887231c9 100644 --- a/.pipelines/templates/release-upload-buildinfo.yml +++ b/.pipelines/templates/release-upload-buildinfo.yml @@ -112,7 +112,7 @@ jobs: Write-Host 'AzureRM module removed' } - ./tools/installPSResource.ps1 -PSRepository CFS -Verbose + ./tools/installPSResource.ps1 -PSRepository CFS displayName: Remove AzRM modules - task: AzurePowerShell@5 From 38248999932802ae6863fbb7c2c29822aeef018b Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Tue, 11 Mar 2025 10:00:42 -0500 Subject: [PATCH 10/12] Remove install of Az modules and uninstall of AzureRM --- .pipelines/templates/checkAzureContainer.yml | 9 -------- .pipelines/templates/compliance/apiscan.yml | 4 ---- .../templates/compliance/generateNotice.yml | 13 ----------- .../templates/release-MakeBlobPublic.yml | 22 ------------------- .pipelines/templates/release-create-msix.yml | 12 ---------- .../templates/release-upload-buildinfo.yml | 11 ---------- .../release-validate-packagenames.yml | 12 ---------- .pipelines/templates/uploadToAzure.yml | 12 ---------- 8 files changed, 95 deletions(-) diff --git a/.pipelines/templates/checkAzureContainer.yml b/.pipelines/templates/checkAzureContainer.yml index f8aafc58c3a..f5e36f38a92 100644 --- a/.pipelines/templates/checkAzureContainer.yml +++ b/.pipelines/templates/checkAzureContainer.yml @@ -51,15 +51,6 @@ jobs: } displayName: 'Check suppress.json' - # Needed as per FAQ here: https://eng.ms/docs/products/onebranch/build/troubleshootingfaqs - - task: PowerShell@2 - displayName: 'Update Az.Storage Module' - inputs: - targetType: 'inline' - script: | - ./tools/installPSResource.ps1 -PSRepository CFS - Uninstall-AzureRm -Verbose - - task: AzurePowerShell@5 displayName: Check if blob exists and delete if specified inputs: diff --git a/.pipelines/templates/compliance/apiscan.yml b/.pipelines/templates/compliance/apiscan.yml index dd5fff8aa2d..4e945b40349 100644 --- a/.pipelines/templates/compliance/apiscan.yml +++ b/.pipelines/templates/compliance/apiscan.yml @@ -78,10 +78,6 @@ jobs: workingDirectory: '$(repoRoot)' retryCountOnTaskFailure: 2 - - pwsh: ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Install PowerShell modules - workingDirectory: '$(repoRoot)' - - task: AzurePowerShell@5 displayName: Download winverify-private Artifacts inputs: diff --git a/.pipelines/templates/compliance/generateNotice.yml b/.pipelines/templates/compliance/generateNotice.yml index 1cf540b87a8..b9d489795b1 100644 --- a/.pipelines/templates/compliance/generateNotice.yml +++ b/.pipelines/templates/compliance/generateNotice.yml @@ -95,19 +95,6 @@ jobs: Get-PackageProvider -Name NuGet -ForceBootstrap displayName: Initalize PowerShellGet - - pwsh: ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Install PowerShell modules - - - powershell: | - if(Get-Command -Name Uninstall-AzureRm -ErrorAction Ignore){ - Write-Verbose "running Uninstall-AzureRm" -verbose - Uninstall-AzureRm - } else { - Write-Verbose "Uninstall-AzureRm not present" -verbose - } - displayName: Uninstall Uninstall-AzureRm - continueOnError: true - - task: AzurePowerShell@5 displayName: Upload Notice inputs: diff --git a/.pipelines/templates/release-MakeBlobPublic.yml b/.pipelines/templates/release-MakeBlobPublic.yml index 707ec8e55dd..c6aeebb57be 100644 --- a/.pipelines/templates/release-MakeBlobPublic.yml +++ b/.pipelines/templates/release-MakeBlobPublic.yml @@ -51,17 +51,6 @@ jobs: Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose displayName: 'Capture Environment Variables' - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Remove AzRM modules - - task: AzurePowerShell@5 displayName: Copy blobs to PSInfra storage inputs: @@ -149,17 +138,6 @@ jobs: Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose displayName: 'Capture Environment Variables' - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Remove AzRM modules - - task: AzurePowerShell@5 displayName: Copy blobs to PSInfra storage inputs: diff --git a/.pipelines/templates/release-create-msix.yml b/.pipelines/templates/release-create-msix.yml index d8cf1453719..3714e623b5e 100644 --- a/.pipelines/templates/release-create-msix.yml +++ b/.pipelines/templates/release-create-msix.yml @@ -27,18 +27,6 @@ jobs: artifact: drop_windows_package_package_win_x86 displayName: Download x86 msix patterns: '**/*.msix' - - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Remove AzRM modules and install Az.Storage - # Finds the makeappx tool on the machine with image: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' - pwsh: | diff --git a/.pipelines/templates/release-upload-buildinfo.yml b/.pipelines/templates/release-upload-buildinfo.yml index af7887231c9..8d59078b905 100644 --- a/.pipelines/templates/release-upload-buildinfo.yml +++ b/.pipelines/templates/release-upload-buildinfo.yml @@ -104,17 +104,6 @@ jobs: } displayName: Create json files - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - displayName: Remove AzRM modules - - task: AzurePowerShell@5 displayName: Upload buildjson to blob inputs: diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index e410b7bf025..983d6690036 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -28,18 +28,6 @@ jobs: Write-Host "##vso[build.updatebuildnumber]$name" displayName: Set Release Name - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - - displayName: Remove AzRM modules and install Az.Storage - - task: AzurePowerShell@5 displayName: Upload packages to blob inputs: diff --git a/.pipelines/templates/uploadToAzure.yml b/.pipelines/templates/uploadToAzure.yml index e9d6ea22339..e35201cf1c7 100644 --- a/.pipelines/templates/uploadToAzure.yml +++ b/.pipelines/templates/uploadToAzure.yml @@ -256,18 +256,6 @@ jobs: New-Item -Path $(Build.ArtifactStagingDirectory)/uploaded -ItemType Directory -Force displayName: Create output directory for packages - - pwsh: | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose - if ($azureRmModule) { - Write-Host 'AzureRM module exists. Removing it' - Uninstall-AzureRm - Write-Host 'AzureRM module removed' - } - - ./tools/installPSResource.ps1 -PSRepository CFS - - displayName: Remove AzRM modules - - task: AzurePowerShell@5 displayName: Upload packages to blob inputs: From 580669657465f3a2445cd7232cc7d0f68fa60ba2 Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Tue, 11 Mar 2025 10:02:53 -0500 Subject: [PATCH 11/12] Use correct name for Binaries pipeline --- .pipelines/PowerShell-Release-Official-Azure.yml | 2 +- .pipelines/PowerShell-Release-Official.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/PowerShell-Release-Official-Azure.yml b/.pipelines/PowerShell-Release-Official-Azure.yml index acba669ffa3..2d644c7a5dd 100644 --- a/.pipelines/PowerShell-Release-Official-Azure.yml +++ b/.pipelines/PowerShell-Release-Official-Azure.yml @@ -56,7 +56,7 @@ resources: pipelines: - pipeline: CoOrdinatedBuildPipeline - source: 'PowerShell-Coordinated Packages-Official' + source: 'PowerShell-Coordinated Binaries-Official' - pipeline: PSPackagesOfficial source: 'PowerShell-Packages-Official' diff --git a/.pipelines/PowerShell-Release-Official.yml b/.pipelines/PowerShell-Release-Official.yml index 81de35b9c9a..d83b04465f0 100644 --- a/.pipelines/PowerShell-Release-Official.yml +++ b/.pipelines/PowerShell-Release-Official.yml @@ -72,7 +72,7 @@ resources: pipelines: - pipeline: CoOrdinatedBuildPipeline - source: 'PowerShell-Coordinated Packages-Official' + source: 'PowerShell-Coordinated Binaries-Official' - pipeline: PSPackagesOfficial source: 'PowerShell-Packages-Official' From fbc3e41f27c4239e02ba38a7946bea3af5ef15fe Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Tue, 11 Mar 2025 10:46:16 -0500 Subject: [PATCH 12/12] Remove CFS tool --- tools/installPSResources.ps1 | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 tools/installPSResources.ps1 diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 deleted file mode 100644 index 4ab1a9dc4bb..00000000000 --- a/tools/installPSResources.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -param( - [ValidateSet("PSGallery", "CFS")] - [string]$PSRepository = "PSGallery" -) - -if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) { - Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" -} - -# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to -# request an exact version. Otherwise, if a newer version is available in the -# upstream feed, it will fail to install any version at all. -Install-PSResource -Verbose -TrustRepository -RequiredResource @{ - "Az.Accounts" = @{ - version = "4.0.2" - repository = $PSRepository - } - "Az.Storage" = @{ - version = "8.1.0" - repository = $PSRepository - } -}