Skip to content

Commit 54b7832

Browse files
author
Einar Egilsson
committed
Merge pull request kzu#3 from bfriesen/master
Fix uninstall.ps1
2 parents 6d2c787 + 1ab668f commit 54b7832

1 file changed

Lines changed: 2 additions & 31 deletions

File tree

nuget/tools/uninstall.ps1

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
11
param($installPath, $toolsPath, $package, $project)
22

3-
function Resolve-ProjectName {
4-
param(
5-
[parameter(ValueFromPipelineByPropertyName = $true)]
6-
[string[]]$ProjectName
7-
)
8-
9-
if($ProjectName) {
10-
$projects = Get-Project $ProjectName
11-
}
12-
else {
13-
# All projects by default
14-
$projects = Get-Project
15-
}
16-
17-
$projects
18-
}
19-
20-
function Get-MSBuildProject {
21-
param(
22-
[parameter(ValueFromPipelineByPropertyName = $true)]
23-
[string[]]$ProjectName
24-
)
25-
Process {
26-
(Resolve-ProjectName $ProjectName) | % {
27-
$path = $_.FullName
28-
@([Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($path))[0]
29-
}
30-
}
31-
}
32-
33-
$buildProject = Get-MSBuildProject
3+
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
4+
$buildProject = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
345
$projectRoot = $buildProject.Xml;
356

367
Foreach ($target in $projectRoot.Targets)

0 commit comments

Comments
 (0)