forked from DynamicsValue/fake-xrm-easy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
restore-configuration.ps1
34 lines (27 loc) · 1.08 KB
/
restore-configuration.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
param (
[string]$targetFrameworks = "net6.0",
[string]$configuration = "FAKE_XRM_EASY_9"
)
$localPackageRestoreFolder = './packages'
Write-Host "Deleting previous dependencies..." -ForegroundColor Yellow
$restoredPackagesFolder = './packages'
$restoredPackagesFolderExists = Test-Path $restoredPackagesFolder -PathType Container
if($restoredPackagesFolderExists)
{
Get-ChildItem -Path $restoredPackagesFolder -Include fakexrmeasy.* -Directory -Recurse -Force | Remove-Item -Recurse -Force
}
else
{
New-Item $restoredPackagesFolder -ItemType Directory
}
if($targetFrameworks -eq "all")
{
dotnet restore --no-cache --force --force-evaluate /p:Configuration=$configuration /p:PackTests=$packTests --packages $restoredPackagesFolder
}
else {
dotnet restore --no-cache --force --force-evaluate /p:Configuration=$configuration /p:PackTests=$packTests /p:TargetFrameworks=$targetFrameworks --packages $restoredPackagesFolder
}
if(!($LASTEXITCODE -eq 0)) {
throw "Error restoring packages"
}
Write-Host "Done. It's convenient to restart vscode after this." -ForegroundColor Green