Toolcache: fix typos in windows toolcache provisioners

This commit is contained in:
Maksim Petrov
2019-12-30 14:51:09 +03:00
parent 6aa21f425e
commit d1ed5029b5
2 changed files with 4 additions and 5 deletions

View File

@@ -29,8 +29,7 @@ $ToolsDirectory = $Dest + $Path
$env:AGENT_TOOLSDIRECTORY = $ToolsDirectory $env:AGENT_TOOLSDIRECTORY = $ToolsDirectory
setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M
# Install tools form NPM # Install HostedToolCache tools via NPM
$ToolVersionsFileContent = Get-Content -Path "$env:ROOT_FOLDER/toolcache.json" -Raw $ToolVersionsFileContent = Get-Content -Path "$env:ROOT_FOLDER/toolcache.json" -Raw
$ToolVersions = ConvertFrom-Json -InputObject $ToolVersionsFileContent $ToolVersions = ConvertFrom-Json -InputObject $ToolVersionsFileContent

View File

@@ -37,14 +37,14 @@ function ToolcacheTest {
if (Test-Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName") if (Test-Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName")
{ {
$description = "" $description = ""
[array]$instaledVersions = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName" [array]$installedVersions = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName"
if ($instaledVersions.count -gt 0){ if ($installedVersions.count -gt 0){
$softwarePackages = $packages | Where-Object { $_.ToolName -eq $SoftwareName } $softwarePackages = $packages | Where-Object { $_.ToolName -eq $SoftwareName }
foreach($softwarePackage in $softwarePackages) foreach($softwarePackage in $softwarePackages)
{ {
foreach ($version in $softwarePackage.Versions) foreach ($version in $softwarePackage.Versions)
{ {
$foundVersion = $instaledVersions | where { $_.StartsWith($version) } $foundVersion = $installedVersions | where { $_.StartsWith($version) }
if ($foundVersion -ne $null){ if ($foundVersion -ne $null){