You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
809 B

param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath "CommonPropertyValues.ps1");
. (Join-Path $toolsPath "ImportMSBuild.ps1");
# Find and remove the property group
$allMatchingProperties = $msbuild.Xml.Properties | Where-Object { $_.Name -eq $inProjectFileUniquePackageRelativeUtilityAssembliesFolderPropertyName };
$firstMatchingProperty = $allMatchingProperties | Select-Object -First 1;
$msbuild.Xml.RemoveChild($firstMatchingProperty.Parent) | Out-Null;
# Find and remove the target
$allMatchingTargets = $msbuild.Xml.Targets | Where-Object { $_.Name -eq $inProjectFileUniqueCopyUtilityAssembliesTargetName };
$firstMatchingTarget = $allMatchingTargets | Select-Object -First 1;
$msbuild.Xml.RemoveChild($firstMatchingTarget) | Out-Null;
# Save the project
$project.Save();