Welcome to MSDN Blogs Sign in | Join | Help

Controlling WinDbg with PowerShell

Roberto Farah runs a Debugging Toolbox blog and recently got turned onto PowerShell. He has now written a set of PowerShell functions (PowerDbg Library) which allows PowerShell to control WinDbg. The effect is (almost) the same as if WinDbg had embedded PowerShell as its own scripting language. Roberto considered a couple approaches before deciding to leverage the WScript.Shell com object and the SendKeys method to get the job done. (Note to self – learn more about what things can be done with this approach.).

 

One note on style/naming. Roberto's functions put his library name at the beginning of the name:

PowerDbgSend-Command

As a general rule, we encourage people to include their product name or some facility code as part of their cmdlet/function name to avoid naming collisions. The correct way to do this is to make it part of the NOUN not the verb. As such, the names should be in the form:

Send-PowerDbgCommand

Other than that, this stuff is great! Check out this very cool stuff HERE.

Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Published Sunday, September 09, 2007 8:19 PM by PowerShellTeam

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Controlling WinDbg with PowerShell

It seems putting the package name first would make it easier to find commands from certain packages with tab completion.

(ex. I know I want a command from PowerDbg but I can't remember which one)

Sunday, September 09, 2007 4:58 PM by jabbera

# MSDN Blog Postings » Controlling WinDbg with PowerShell

Sunday, September 09, 2007 5:48 PM by MSDN Blog Postings » Controlling WinDbg with PowerShell

# re: Controlling WinDbg with PowerShell

I just changed the function names according to your comments.

Thanks for the article!

Sunday, September 09, 2007 8:46 PM by Roberto Farah

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker