mirror of
https://github.com/actions/runner-images.git
synced 2025-12-26 19:38:57 +08:00
refactor and rename scripts
This commit is contained in:
@@ -4,19 +4,9 @@ $dotnetPath = "$env:USERPROFILE\.dotnet\tools"
|
||||
if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools"))
|
||||
{
|
||||
$latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath")
|
||||
$isPathUpdated = $true
|
||||
}
|
||||
|
||||
if (-not $latestPath.Contains($dotnetPath))
|
||||
{
|
||||
$latestPath = "$dotnetPath;$latestPath"
|
||||
Write-Host "Added .dotnet\tools $dotnetPath to PATH"
|
||||
$isPathUpdated = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$dotnetPath already in PATH"
|
||||
}
|
||||
|
||||
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
Write-Host "Windows PATH: $updatedPath"
|
||||
}
|
||||
8
images/win/post-generation/MercurialPath.ps1
Normal file
8
images/win/post-generation/MercurialPath.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$hgPath = "$Env:ProgramFiles\Mercurial\"
|
||||
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
if (Test-Path -Path $hgPath)
|
||||
{
|
||||
$latestPath = "$hgPath;$latestPath"
|
||||
Write-Host "Added Mercurial to PATH"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
$hgPath = "$Env:ProgramFiles\Mercurial\"
|
||||
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
if (Test-Path -Path $hgPath)
|
||||
{
|
||||
$latestPath = "$hgPath;$latestPath"
|
||||
Write-Host "Added Mercurial to PATH"
|
||||
$isPathUpdated = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it."
|
||||
}
|
||||
|
||||
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
Write-Host "Windows PATH: $updatedPath"
|
||||
Reference in New Issue
Block a user