简体   繁体   中英

Visual Studio Immediate Window & PowerShell

As you know Visual Studio's Immediate Window is very limited. You cannot even use loops there.

I am just curious is this possible to integrate PowerShell into Immediate Window? It will make debugging a lot-lot easier. We will have loops, lambdas etc...

I've thought about PowerConsole but this is not integrated with debugger.

Any ideas?

Have you tried PowerConsole for this? I haven't used it lately but I know you can access Visual Studio's DTE object and from there you should be able to grab the Debugger interface eg $dte.Debugger .

I was just checking out the PowerConsole project site to see if there was a version for VS 2012. The project owner claims that the NuGet Package Manager Console was a fork of PowerConsole. And sure enough, this does from the Package Manager Console. I just tried it:

$dte.debugger.getexpression("variableName", $true, 2000)

I wanted to get similar behaviour to being able to iterate/dump some variables and collections in a more flexible way. So I came up with a simple VS Add-In and script for Python Shell with similar functionality. I've placed my project on github - https://github.com/dp0h/VsImmediate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM