Files
ArchiSteamFarm/packages/ILBundle.1.0.0.14/Tools/Net40/Uninstall.ps1
2015-12-19 08:22:17 +01:00

11 lines
736 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#http://blogs.clariusconsulting.net/kzu/how-to-add-an-msbuild-import-to-a-project-on-nuget-install/
param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if its not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
$importToRemove = $msbuild.Xml.Imports | Where-Object { $_.Project.Endswith('ILBundle.targets') }
# Remove the import and save the project
$msbuild.Xml.RemoveChild($importToRemove) | out-null
$project.Save()