Skip to content

Commit 8daf046

Browse files
authored
Merge pull request #92 from git-for-windows/update-pwsh-self-hosted
self-hosted runners: use latest `pwsh` version now that arm64 MSIs are available
2 parents 260a84d + 75d72f3 commit 8daf046

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

azure-self-hosted-runners/post-deployment-script.ps1

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -RunAsAdministrator
2+
13
param (
24
# https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
35
[Parameter(Mandatory = $true, HelpMessage = "GitHub Actions Runner registration token. Note that these tokens are only valid for one hour after creation, so we always expect the user to provide one.")]
@@ -119,9 +121,7 @@ catch {
119121
# It contains a bunch of new features compared to "powershell" and is sometimes more stable as well.
120122
#
121123
# url for Github API to get the latest release of pwsh
122-
#
123-
# TODO update this to /releases/latest once 7.5.0 is out, as it adds support for arm64 MSIs
124-
[string]$PwshUrl = "https://api.github.com/repos/PowerShell/PowerShell/releases/tags/v7.5.0-preview.2"
124+
[string]$PwshUrl = "https://api.github.com/repos/PowerShell/PowerShell/releases/latest"
125125

126126
# Name of the MSI file that should be verified and downloaded
127127
[string]$PwshMsiName = "PowerShell-.*-win-arm64.msi"
@@ -238,10 +238,6 @@ $MsiArguments = "/qn /i `"$MsiPath`" ADD_PATH=1"
238238
# Install pwsh using msiexec
239239
Start-Process msiexec.exe -Wait -ArgumentList $MsiArguments
240240

241-
# TODO remove once 7.5.0 is out
242-
Write-Output "Copying pwsh-preview.cmd to pwsh.cmd as a temporary measure until 7.5.0 is out..."
243-
Copy-Item "C:\Program Files\PowerShell\7-preview\preview\pwsh-preview.cmd" "C:\Program Files\PowerShell\7-preview\preview\pwsh.cmd"
244-
245241
Write-Output "Finished installing pwsh."
246242

247243
# ======================

0 commit comments

Comments
 (0)