functions/Install-ToolsPackageFromNuget.ps1
function Install-ToolsPackageFromNuget { [CmdletBinding()] param($PackagePath, $package, $subPath, $version, $environmentVariablesToSet) Write-Host "Installing Package $package" $testPath = Join-Path(Join-Path $PackagePath $package) $subPath if (-not (Test-path $testPath)) { $nugetparams = @("install", $package, "-ExcludeVersion", "-OutputDirectory", $PackagePath) if ($_.version) { $nugetparams += "-version", $_.version } &$nugetpath $nugetparams } if ($_.env) { $_.env | foreach-object { Write-verbose "Setting $_ to $testPath" set-item -path "env:$_" -value $testPath } } } |