Skip to content

Commit 42b72d6

Browse files
Use RequiredResource hashtable to specify PowerShell module versions (#112)
1 parent ab84728 commit 42b72d6

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

SecretStore.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ task Package {
7373
}
7474

7575
task Test {
76-
Invoke-Pester -CI -Output Diagnostic
76+
Invoke-Pester -CI
7777
}
7878

7979
task Build BuildModule, BuildDocs

tools/installPSResources.ps1

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,27 @@ param(
66
)
77

88
if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) {
9-
Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json"
9+
Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json"
1010
}
1111

12-
Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild
13-
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS
14-
Install-PSResource -Repository $PSRepository -TrustRepository -Name Pester
15-
Install-PSResource -Repository $PSRepository -TrustRepository -Name Microsoft.PowerShell.SecretManagement
12+
# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to
13+
# request an exact version. Otherwise, if a newer version is available in the
14+
# upstream feed, it will fail to install any version at all.
15+
Install-PSResource -Verbose -TrustRepository -RequiredResource @{
16+
InvokeBuild = @{
17+
version = "5.12.1"
18+
repository = $PSRepository
19+
}
20+
platyPS = @{
21+
version = "0.14.2"
22+
repository = $PSRepository
23+
}
24+
Pester = @{
25+
version = "5.7.1"
26+
repository = $PSRepository
27+
}
28+
"Microsoft.PowerShell.SecretManagement" = @{
29+
version = "1.1.2"
30+
repository = $PSRepository
31+
}
32+
}

0 commit comments

Comments
 (0)