Skip to content

Commit 9dacfa8

Browse files
Use RequiredResource hashtable to specify PowerShell module versions (#2053)
1 parent a744b6c commit 9dacfa8

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tools/installPSResources.ps1

+14-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@ 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 platyPS
13-
Install-PSResource -Repository $PSRepository -TrustRepository -Name Pester
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+
platyPS = @{
17+
version = "0.14.2"
18+
repository = $PSRepository
19+
}
20+
Pester = @{
21+
version = "5.7.1"
22+
repository = $PSRepository
23+
}
24+
}

0 commit comments

Comments
 (0)