mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[release/v7.4]Remove Az module installs and AzureRM uninstalls in pipeline (#25157)
Co-authored-by: Justin Chung <chungjustin@microsoft.com>
This commit is contained in:
co-authored by
Justin Chung
parent
bc463d9721
commit
4a053a4e0f
@@ -64,7 +64,7 @@ variables:
|
||||
resources:
|
||||
pipelines:
|
||||
- pipeline: CoOrdinatedBuildPipeline
|
||||
source: 'PowerShell-Coordinated Packages-Official'
|
||||
source: 'PowerShell-Coordinated Binaries-Official'
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
|
||||
@@ -56,7 +56,7 @@ resources:
|
||||
|
||||
pipelines:
|
||||
- pipeline: CoOrdinatedBuildPipeline
|
||||
source: 'PowerShell-Coordinated Packages-Official'
|
||||
source: 'PowerShell-Coordinated Binaries-Official'
|
||||
|
||||
- pipeline: PSPackagesOfficial
|
||||
source: 'PowerShell-Packages-Official'
|
||||
|
||||
@@ -72,7 +72,7 @@ resources:
|
||||
|
||||
pipelines:
|
||||
- pipeline: CoOrdinatedBuildPipeline
|
||||
source: 'PowerShell-Coordinated Packages-Official'
|
||||
source: 'PowerShell-Coordinated Binaries-Official'
|
||||
|
||||
- pipeline: PSPackagesOfficial
|
||||
source: 'PowerShell-Packages-Official'
|
||||
|
||||
@@ -51,16 +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: |
|
||||
Get-PackageProvider -Name NuGet -ForceBootstrap
|
||||
Install-Module -Name Az.Storage -Verbose -Force -AllowClobber
|
||||
Uninstall-AzureRm -Verbose
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Check if blob exists and delete if specified
|
||||
inputs:
|
||||
|
||||
@@ -78,19 +78,6 @@ jobs:
|
||||
workingDirectory: '$(repoRoot)'
|
||||
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
|
||||
}
|
||||
}
|
||||
displayName: Install PowerShell modules
|
||||
workingDirectory: '$(repoRoot)'
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Download winverify-private Artifacts
|
||||
inputs:
|
||||
|
||||
@@ -95,29 +95,6 @@ jobs:
|
||||
Get-PackageProvider -Name NuGet -ForceBootstrap
|
||||
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
|
||||
}
|
||||
}
|
||||
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:
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
displayName: Remove AzRM modules
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Copy blobs to PSInfra storage
|
||||
inputs:
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
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: |
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
displayName: Remove AzRM modules
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Upload buildjson to blob
|
||||
inputs:
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
|
||||
displayName: Remove AzRM modules and install Az.Storage
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Upload packages to blob
|
||||
inputs:
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
|
||||
|
||||
displayName: Remove AzRM modules
|
||||
|
||||
- task: AzurePowerShell@5
|
||||
displayName: Upload packages to blob
|
||||
inputs:
|
||||
|
||||
Reference in New Issue
Block a user