Kurt Schelfthout blogs Accessing Visual Studio’s Automation API from F# Interactive and reasons:
Because why anyone would want to write VBA in the Visual Studio macro editor is beyond me.
I agree!
Kurt lays out the “how to” for injecting the Visual Studio’s DTE object (Development Tools Extensibility) into the F# console. He also provides the link to Visual Studio .NET Automation Object Model.
PowerShell PowerConsole
Makes accessing the Automation API simple. It brings the Visual Studio DTE automation object to your finger tips. Check this post for downloading PowerConsole – PowerShell Integrated with Visual Studio 2010.
$DTE.Solution.Projects | ForEach {$_.Fullname}
PS> $DTE.Solution.Projects | ForEach {$_.Fullname}
C:\PoShScripts\NYC Code Camp\CSharp\WPF+PoSh\Simple\Simple.csproj
C:\PoShScripts\NYC Code Camp\CSharp\WPF+PoSh\PowerShellExtensions\PowerShellExtensions.csproj
C:\PoShScripts\NYC Code Camp\CSharp\WPF+PoSh\HostAndAddVariables\HostAndAddVariables.csproj



{ 1 trackback }
{ 4 comments… read them below or add one }
Where’s my pails update?
Haven’t forgotten. This is the rabbit hole as it currently stands
Good stuff, this PowerConsole.
Does it use roughly the same method as in my post to find out which VS instance to connect to?
Kurt, good question. Don’t know. I haven’t used reflector on PowerConsole yet. It is implemented as a 2010 extension, so my guess is it uses MEF to find the DTE services and injects it into the PowerShell runspace as a variable.