-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.ps1
31 lines (22 loc) · 883 Bytes
/
install.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
param($installPath, $toolsPath, $package, $project)
Write-Host "Using tools path $toolsPath"
$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "lib\portable45-net45+win8" ) * -Resolve
Write-Host "detected analyzer paths... $analyzersPaths"
foreach($analyzersPath in $analyzersPaths)
{
Write-Host "using path $analyzersPath"
# Install the language agnostic analyzers.
if (Test-Path $analyzersPath)
{
foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll)
{
Write-Host "using file path $analyzerFilePath"
if($project.Object.AnalyzerReferences)
{
$project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
}
}
}
}
$item = $project.ProjectItems.Item("ForbiddenReferences.xml")
$item.Properties.Item("BuildAction").Value = 4