Created
July 3, 2013 04:47
-
-
Save CaitieM20/5915504 to your computer and use it in GitHub Desktop.
Powershell script to be used with Nuget packages. On install it programatically discovers all T4 Text Template Files in the Nuget Package and modifies their addition to the Project to exclude the Generator and LastGenOutput tags.
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
param($installPath, $toolsPath, $package, $project) | |
#Get all of the T4 files in the package extension .tt | |
$files = $package.GetFiles() | Where-Object {$_.EffectivePath -match "tt$"} | |
foreach ($file in $files) | |
{ | |
$fileName = $file.EffectivePath | |
$ProjectItem = $project.ProjectItems | Where-Object {$_.Name -eq $fileName} | |
#Set CustomTool to empty not TextTemplatingFileGenerator | |
$CustomTool = $ProjectItem.Properties | where-object {$_.Name -eq "CustomTool"} | |
$CustomTool.Value = "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment