-
Notifications
You must be signed in to change notification settings - Fork 251
Expand file tree
/
Copy pathinstallPSResources.ps1
More file actions
25 lines (23 loc) · 973 Bytes
/
installPSResources.ps1
File metadata and controls
25 lines (23 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[ValidateSet("PSGallery", "CFS")]
[string]$PSRepository = "PSGallery"
)
# Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it
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/PowerShellGalleryMirror/nuget/v3/index.json"
}
# 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.14.23"
repository = $PSRepository
}
platyPS = @{
version = "0.14.2"
repository = $PSRepository
}
}