Skip to content

Add-Path not being recognised in builds #922

Open
@rjmholt

Description

@rjmholt

This line:

Add-Path C:/Users/ContainerAdministrator/AppData/Local/Microsoft/dotnet; `

Is failing in builds. It's not a problem, since things succeed anyway, but I don't think it's working as intended.

It's defined here:

function Add-Path
{
param
(
$path
)
$machinePathString = [System.Environment]::GetEnvironmentVariable('path',[System.EnvironmentVariableTarget]::Machine)
$machinePath = $machinePathString -split ';'
if($machinePath -inotcontains $path)
{
$newPath = "$machinePathString;$path"
Write-Verbose "Adding $path to path..." -Verbose
[System.Environment]::SetEnvironmentVariable('path',$newPath,[System.EnvironmentVariableTarget]::Machine)
Write-Verbose "Added $path to path." -Verbose
$env:Path += ";$newPath"
}
else
{
Write-Verbose "$path already in path." -Verbose
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions