Skip to content

Commit 7bf3185

Browse files
committed
Add setupReleaseTools.ps1 script
This installs the necessary modules and authenticates using a given GitHub token so that the Azure pipelines can use our `ReleaseTools` module to publish to GitHub.
1 parent d54ffc7 commit 7bf3185

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/setupReleaseTools.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
param(
5+
[Parameter(Mandatory)]
6+
[string]$Token
7+
)
8+
9+
Write-Host "Install and import PowerShell modules"
10+
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
11+
Install-Module -Name PowerShellForGitHub -Scope CurrentUser -Force
12+
Import-Module $PSScriptRoot/ReleaseTools.psm1
13+
14+
Write-Host "Setup authentication"
15+
Set-GitHubConfiguration -SuppressTelemetryReminder
16+
$password = ConvertTo-SecureString -String $Token -AsPlainText -Force
17+
Set-GitHubAuthentication -Credential (New-Object System.Management.Automation.PSCredential ("token", $password))

0 commit comments

Comments
 (0)