September 9th, 2007

Controlling WinDbg with PowerShell

PowerShell Team
PowerShell Team

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

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.