From 0183abb8c70325da683f87e3dbbaef5b51f7545c Mon Sep 17 00:00:00 2001 From: Florian Eiden Date: Sun, 9 Feb 2020 21:57:46 -0800 Subject: [PATCH] Fix issue #1 --- unittest/2_act/Install-AutToolset.ps1 | 45 ++++++++++++++++----------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/unittest/2_act/Install-AutToolset.ps1 b/unittest/2_act/Install-AutToolset.ps1 index ef8e950..5bc8afe 100644 --- a/unittest/2_act/Install-AutToolset.ps1 +++ b/unittest/2_act/Install-AutToolset.ps1 @@ -37,22 +37,29 @@ param ( [string]$unittestFolder ="unittest" ) -Set-Location "$solutionPath\$unittestFolder\2_act" | - Out-Null - -# Windows - get nuget.exe from https://www.nuget.org/downloads -Write-Verbose "001 - Download nuget.exe" -Invoke-WebRequest ` - -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ` - -OutFile nuget.exe | - Out-Null - -# Install ASA CI/CD package from nuget -Write-Verbose "002 - Install ASA.CICD nuget package" -Invoke-Expression "./nuget install Microsoft.Azure.StreamAnalytics.CICD -version $ASAnugetVersion" | - Out-Null - -# Install jsondiffpatch from npm -Write-Verbose "003 - Install jsondiffpatch npm package" -Invoke-Expression "npm install -g jsondiffpatch" | - Out-Null +$actPath = "$solutionPath\$unittestFolder\2_act" + +if (Test-Path $actPath) +{ + Set-Location $actPath + + # Windows - get nuget.exe from https://www.nuget.org/downloads + Write-Verbose "001 - Download nuget.exe" + Invoke-WebRequest ` + -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ` + -OutFile nuget.exe | + Out-Null + + # Install ASA CI/CD package from nuget + Write-Verbose "002 - Install ASA.CICD nuget package" + Invoke-Expression "./nuget install Microsoft.Azure.StreamAnalytics.CICD -version $ASAnugetVersion" | + Out-Null + + # Install jsondiffpatch from npm + Write-Verbose "003 - Install jsondiffpatch npm package" + Invoke-Expression "npm install -g jsondiffpatch" | + Out-Null +} +else { + throw("The path provided is not valid: $actPath") +} \ No newline at end of file