Question

I have a code generation tool which is in PowerShell Script file (.ps1 files) and I call it through Package Manager console. At the end of code generation automation I need to click on "Transform All Templates" button in Solution Explorer. I want to know if there is a way to virtualize this through PowerShell script or not?

NOTE: I couldn't find the related code through Recording Macros too.

Was it helpful?

Solution

I found a simple solution which is sourced from here : MSDN Forum

[Reflection.Assembly]::Load("EnvDTE")                                               
$DTE.ExecuteCommand("TextTransformation.TransformAllTemplates") 

The above code can be executed through a PS1 file or in NuGet console. It works in VS 2010 SP1 as I tested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top