Remove unneeded Invoke-Expression on unvalidated input (#8826)

Remove unneeded `Invoke-Expression` on unvalidated input
This commit is contained in:
Travis Plunk
2019-02-05 10:48:34 -08:00
committed by GitHub
parent 0606c27cb0
commit ec3bd62782
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -386,7 +386,7 @@ try {
if ($uid -ne "0") { $SUDO = "sudo" } else { $SUDO = "" }
Write-Verbose "Make symbolic link '$symlink' point to '$targetPath'..." -Verbose
Invoke-Expression -Command "$SUDO ln -fs $targetPath $symlink"
& $SUDO ln -fs $targetPath $symlink
if ($LASTEXITCODE -ne 0) {
Write-Error "Could not add to PATH: failed to make '$symlink' point to '$targetPath'."