Warm Module Cache #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Warm Module Cache | |
| on: | |
| push: | |
| branches: [main, development] | |
| schedule: | |
| - cron: '0 6 * * 3,6' # Wednesday and Saturday 06:00 UTC | |
| workflow_dispatch: | |
| jobs: | |
| warm-cache: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Cache PowerShell modules | |
| id: cache-powershell-modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~\Documents\PowerShell\Modules | |
| key: ps-modules-${{ runner.os }}-v1 | |
| - name: Install modules | |
| if: steps.cache-powershell-modules.outputs.cache-hit != 'true' | |
| shell: pwsh | |
| run: | | |
| Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | |
| $modules = @('Pester','PSFramework','PSModuleDevelopment','PSScriptAnalyzer','psake') | |
| foreach ($module in $modules) { | |
| Write-Host "Installing $module..." | |
| Install-Module -Name $module -Scope CurrentUser -Force -SkipPublisherCheck | |
| } |