Last active
December 17, 2015 05:18
-
-
Save trayburn/5556633 to your computer and use it in GitHub Desktop.
This file contains 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
$project = ".\ConsoleApplication1.csproj" | |
$file = "<Compile Include='Models\NewClass.cs' />" | |
[xml](Get-Content $project) | ` | |
Set-Variable -Name doc | ` | |
Select-Xml "//x:ItemGroup[x:Compile]" -Namespace @{"x"=$doc.Project.xmlns} | ` | |
Select-Object -ExpandProperty Node -First 1 | ` | |
% { $_.InnerXml += $file; $doc.Save($project) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby version: https://gist.github.com/amirrajan/5555789