cache powershell modules

This change saves PowerShell modules used in the Azure Pipelines to a
cache, and loads them when required. This is intended to prevent random
failures when the PowerShell Gallery fails to provide the requested
modules. These failures occur at random, possibly as a result of a
backpressure mechanism.

This change will also speed up all Windows Azure Pipelines jobs, since
downloads from the PowerShell Gallery will no longer be necessary.
This commit is contained in:
David Dalcino
2021-12-07 12:41:17 -08:00
parent 1975d80ea3
commit b72891f139
2 changed files with 44 additions and 4 deletions

View File

@@ -46,6 +46,10 @@ jobs:
vmImage: 'windows-2019'
strategy:
matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.windows'] ]
variables:
MODULES_FOLDER: '$(System.DefaultWorkingDirectory)\CachedPowershellModules'
startYear: $[format('{0:yyyy}', pipeline.startTime)]
startMonth: $[format('{0:MM}', pipeline.startTime)]
steps:
- template: ci/steps.yml