forked from Azure/usql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to install multiple USQL sdk
- Loading branch information
Saveen Reddy
committed
Sep 6, 2017
1 parent
b8a3964
commit cfc76c5
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |