forked from alex-y-su/MethodDecorator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.ps1
More file actions
32 lines (21 loc) · 750 Bytes
/
uninstall.ps1
File metadata and controls
32 lines (21 loc) · 750 Bytes
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
param($installPath, $toolsPath, $package, $project)
function Update-FodyConfig($addinName, $project)
{
$fodyWeaversPath = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($project.FullName), "FodyWeavers.xml")
if (!(Test-Path ($fodyWeaversPath)))
{
return
}
$env:FodyLastProjectPath = $project.FullName
$env:FodyLastWeaverName = $addinName
$env:FodyLastXmlContents = [IO.File]::ReadAllText($fodyWeaversPath)
$xml = [xml](get-content $fodyWeaversPath)
$weavers = $xml["Weavers"]
$node = $weavers.SelectSingleNode($addinName)
if ($node)
{
$weavers.RemoveChild($node)
}
$xml.Save($fodyWeaversPath)
}
Update-FodyConfig $package.Id.Replace(".Fody", "") $project