Skip to content

Commit 03d945c

Browse files
committed
Use RequiredResource hashtable to specify PowerShell module versions
1 parent 32cf60c commit 03d945c

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 InvokeBuild
13-
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS
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+
}

0 commit comments

Comments
 (0)