Files
runner-images/images/win/post-generation/Update-MercurialPath.ps1
Dibir Magomedsaygitov 85b60d074c resolve comments
2020-09-30 12:34:36 +03:00

16 lines
551 B
PowerShell

$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"