mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Refactor PATH helpers (#8885)
This commit is contained in:
committed by
GitHub
parent
c73276d3f6
commit
bfe32a2b12
@@ -6,18 +6,6 @@ function Get-EnvironmentVariable($variable) {
|
||||
return [System.Environment]::GetEnvironmentVariable($variable, "Machine")
|
||||
}
|
||||
|
||||
# Update environment variables without reboot
|
||||
function Update-Environment {
|
||||
$variables = [Environment]::GetEnvironmentVariables("Machine")
|
||||
$variables.Keys | ForEach-Object {
|
||||
$key = $_
|
||||
$value = $variables[$key]
|
||||
Set-Item -Path "env:$key" -Value $value
|
||||
}
|
||||
# We need to refresh PATH the latest one because it could include other variables "%M2_HOME%/bin"
|
||||
$env:PATH = [Environment]::GetEnvironmentVariable("PATH", "Machine")
|
||||
}
|
||||
|
||||
function Invoke-PesterTests {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
Reference in New Issue
Block a user