Skip to content

Commit

Permalink
Use RequiredResource hashtable to for PowerShell modules (#235)
Browse files Browse the repository at this point in the history
And new PowerShell Gallery mirror.
  • Loading branch information
andyleejordan authored Jan 31, 2025
1 parent 6a8d420 commit d9680bf
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tools/installPSResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@ param(
)

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

Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS
Install-PSResource -Repository $PSRepository -TrustRepository -Name Pester
# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to
# request an exact version. Otherwise, if a newer version is available in the
# upstream feed, it will fail to install any version at all.
Install-PSResource -Verbose -TrustRepository -RequiredResource @{
InvokeBuild = @{
version = "5.12.1"
repository = $PSRepository
}
platyPS = @{
version = "0.14.2"
repository = $PSRepository
}
Pester = @{
version = "5.7.1"
repository = $PSRepository
}
}

0 comments on commit d9680bf

Please sign in to comment.