Skip to content

Commit

Permalink
Remove use of Invoke-Expression in test script (#2921)
Browse files Browse the repository at this point in the history
  • Loading branch information
florelis committed Feb 3, 2023
1 parent badb1f2 commit 27a055e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/CorrelationTestbed/InSandboxScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ Write-Host @"

$installAndCorrelateOutPath = Join-Path $OutputPath "install_and_correlate.json"

$installAndCorrelationExpression = Join-Path $desktopPath "InstallAndCheckCorrelation\InstallAndCheckCorrelation.exe"
$installAndCorrelationExpression = -join($installAndCorrelationExpression, ' -id "', $PackageIdentifier, '" -src "', $SourceName, '" -out "', $installAndCorrelateOutPath, '"')
$installAndCheckCorrelationExe = Join-Path $desktopPath "InstallAndCheckCorrelation\InstallAndCheckCorrelation.exe"
$installAndCheckCorrelationArgs = @('-id', $PackageIdentifier, '-src', $SourceName, '-out', $installAndCorrelateOutPath)

if ($UseDev)
{
$installAndCorrelationExpression = -join($installAndCorrelationExpression, ' -dev')
$installAndCheckCorrelationArgs += '-dev'
}

if ($MetadataCollection)
{
$wingetUtilPath = Join-Path $PSScriptRoot "WinGetUtil.dll"
$installAndCorrelationExpression = -join($installAndCorrelationExpression, ' -meta "', $wingetUtilPath, '" -sys32 "', $System32Path,'"')
$installAndCheckCorrelationArgs += ('-meta', $wingetUtilPath, '-sys32', $System32Path)
}

Invoke-Expression $installAndCorrelationExpression
& $installAndCheckCorrelationExe $installAndCheckCorrelationArgs

Write-Host @"
Expand Down

0 comments on commit 27a055e

Please sign in to comment.