Created
December 9, 2014 15:20
-
-
Save michaelkc/767a3fd8e937b71a66ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[string]$csprojInFile, | |
[Parameter(Mandatory=$True,Position=2)] | |
[string]$csprojOutFile | |
) | |
$csproj = [xml](get-content $csprojInFile) | |
$xmlns = $csproj.Project.xmlns | |
foreach ($ref in $csproj.Project.ItemGroup.Reference) | |
{ | |
if ($ref.HintPath) | |
{ | |
if (-not $ref.Private) | |
{ | |
$private = $csproj.CreateElement("Private", $xmlns) | |
$private.InnerText = "True" | |
$ref.AppendChild($private) | out-null | |
} | |
} | |
} | |
$csproj.Save($csprojOutFile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment