@@ -18,14 +18,25 @@ jobs:
1818 run : |
1919 $versionConfig = Get-Content '.github/dbatools-library-version.json' | ConvertFrom-Json
2020 $version = $versionConfig.version
21+ $isPreview = $version -like "*preview*"
2122 Write-Output "version=$version" >> $env:GITHUB_OUTPUT
23+ Write-Output "is_preview=$isPreview" >> $env:GITHUB_OUTPUT
2224 Write-Output "Using dbatools.library version: $version"
25+ Write-Output "Is preview version: $isPreview"
2326
24- - name : Install and cache PowerShell modules
27+ - name : Install and cache PowerShell modules (stable versions)
28+ if : steps.get-version.outputs.is_preview == 'False'
2529 uses : potatoqualitee/psmodulecache@v6.2.1
2630 with :
2731 modules-to-cache : dbatools.library:${{ steps.get-version.outputs.version }}
2832
33+ - name : Install dbatools.library (preview versions)
34+ if : steps.get-version.outputs.is_preview == 'True'
35+ shell : pwsh
36+ run : |
37+ Write-Output "Preview version detected, bypassing PSModuleCache and using install script"
38+ ./.github/scripts/install-dbatools-library.ps1
39+
2940 - name : Set encryption values
3041 run : |
3142 Import-Module ./dbatools.psd1 -Force
@@ -77,14 +88,25 @@ jobs:
7788 run : |
7889 $versionConfig = Get-Content '.github/dbatools-library-version.json' | ConvertFrom-Json
7990 $version = $versionConfig.version
91+ $isPreview = $version -like "*preview*"
8092 Write-Output "version=$version" >> $env:GITHUB_OUTPUT
93+ Write-Output "is_preview=$isPreview" >> $env:GITHUB_OUTPUT
8194 Write-Output "Using dbatools.library version: $version"
95+ Write-Output "Is preview version: $isPreview"
8296
83- - name : Install and cache PowerShell modules
97+ - name : Install and cache PowerShell modules (stable versions)
98+ if : steps.get-version.outputs.is_preview == 'False'
8499 uses : potatoqualitee/psmodulecache@v6.2.1
85100 with :
86101 modules-to-cache : dbatools.library:${{ steps.get-version.outputs.version }}
87102
103+ - name : Install dbatools.library (preview versions)
104+ if : steps.get-version.outputs.is_preview == 'True'
105+ shell : pwsh
106+ run : |
107+ Write-Output "Preview version detected, bypassing PSModuleCache and using install script"
108+ ./.github/scripts/install-dbatools-library.ps1
109+
88110 - name : Set encryption values
89111 run : |
90112 Import-Module ./dbatools.psd1 -Force
@@ -136,14 +158,25 @@ jobs:
136158 run : |
137159 $versionConfig = Get-Content '.github/dbatools-library-version.json' | ConvertFrom-Json
138160 $version = $versionConfig.version
161+ $isPreview = $version -like "*preview*"
139162 Write-Output "version=$version" >> $env:GITHUB_OUTPUT
163+ Write-Output "is_preview=$isPreview" >> $env:GITHUB_OUTPUT
140164 Write-Output "Using dbatools.library version: $version"
165+ Write-Output "Is preview version: $isPreview"
141166
142- - name : Install and cache PowerShell modules
167+ - name : Install and cache PowerShell modules (stable versions)
168+ if : steps.get-version.outputs.is_preview == 'False'
143169 uses : potatoqualitee/psmodulecache@v6.2.1
144170 with :
145171 modules-to-cache : dbatools.library:${{ steps.get-version.outputs.version }}
146172
173+ - name : Install dbatools.library (preview versions)
174+ if : steps.get-version.outputs.is_preview == 'True'
175+ shell : pwsh
176+ run : |
177+ Write-Output "Preview version detected, bypassing PSModuleCache and using install script"
178+ ./.github/scripts/install-dbatools-library.ps1
179+
147180 - name : Set encryption values
148181 run : |
149182 Import-Module ./dbatools.psd1 -Force
0 commit comments