Skip to content

Commit

Permalink
Added script to install multiple USQL sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Saveen Reddy committed Sep 6, 2017
1 parent b8a3964 commit cfc76c5
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Examples/LocalRun/InstallUSQLSDKs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#Setup for U-SQL Local Run

Set-StrictMode -Version 2
$ErrorActionPreference = "Stop"

$pkg_names = @(
"Microsoft.Azure.DataLake.USQL.SDK",
"Microsoft.Azure.DataLake.USQL.Interfaces"
)

$pkg_source = "https://www.nuget.org/api/v2/"

$root_pkg_folder = join-path $env:ProgramFiles "PackageManagement\NuGet\Packages\"


function Install-UsqlSdks()
{
if (!(Test-Path $root_pkg_folder))
{
New-Item $root_pkg_folder -type directory
}

foreach ($pkg_name in $pkg_names)
{
Write-Host "Looking for package on Nuget" $pkg_name

$pkg = Find-Package -Name $pkg_name -Source $pkg_source

if ($pkg -eq $null)
{
Throw "DId not find package"
}

Write-Host "Package found"

$pkg_folder = join-path $root_pkg_folder ($pkg.Name + "." + $pkg.Version)
Write-Host "Package will be installed here: " $pkg_folder


$install = $false

if (!(Test-Path $pkg_folder))
{
Write-Host "Package is not installed. Will download and install"
$install = $true
}

if ($install)
{

Write-Host "Installing"
$pkg | Install-Package -Verbose -Destination $root_pkg_folder
}
}
}


Install-UsqlSdks

0 comments on commit cfc76c5

Please sign in to comment.