In Visual Studio 2012, I found it is possible to use DocumentSaved events from DocumentEventsClass. So I have written the following code in PowerShell.
$DTE.Events.DocumentEvents($DTE.ActiveDocument)
However, the COMObject returned is incorrect, (000... GUID). What am I doing wrong?
To execute an action on Save, we found that the easy solution was to set a custom tool on the file. The same way RESX files work.
Basically, we added
MSBuild:CustomTarget
And this target will be called every time you save.