-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update OneBranch pipeline and dependencies (#253)
- Loading branch information
1 parent
472b500
commit 2078bf3
Showing
4 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
param( | ||
[ValidateSet("PSGallery", "CFS")] | ||
[string]$PSRepository = "PSGallery" | ||
) | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null | ||
if ($PSVersionTable.PSVersion.Major -lt 6) { | ||
throw "The build script requires PowerShell 7!" | ||
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" | ||
} | ||
|
||
# TODO: Switch to Install-PSResource when CI uses PowerShell 7.4 | ||
Install-Module -Name InvokeBuild -Scope CurrentUser | ||
Install-Module -Name platyPS -Scope CurrentUser | ||
Install-Module -Name Microsoft.PowerShell.PSResourceGet -Scope CurrentUser | ||
Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild | ||
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS |