{"id":7271,"date":"2007-09-09T15:19:25","date_gmt":"2007-09-09T15:19:25","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2007\/09\/09\/controlling-windbg-with-powershell\/"},"modified":"2019-02-18T13:16:32","modified_gmt":"2019-02-18T20:16:32","slug":"controlling-windbg-with-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/controlling-windbg-with-powershell\/","title":{"rendered":"Controlling WinDbg with PowerShell"},"content":{"rendered":"<p>Roberto Farah runs a <a href=\"http:\/\/blogs.msdn.com\/debuggingtoolbox\/default.aspx\">Debugging Toolbox<\/a> blog and recently got turned onto PowerShell.  He has now written a set of <a href=\"http:\/\/blogs.msdn.com\/debuggingtoolbox\/archive\/2007\/09\/05\/powershell-script-powerdbg-using-powershell-to-control-windbg.aspx\">PowerShell functions<\/a> (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 <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/aew9yb99.aspx\">WScript.Shell<\/a> com object and the <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/8c6yea83.aspx\">SendKeys<\/a> method to get the job done.   (Note to self \u2013 learn more about what things can be done with this approach.).\n<\/p>\n<p>\n\u00a0<\/p>\n<p>One note on style\/naming.  Roberto&#8217;s functions put his library name at the beginning of the name:\n<\/p>\n<p>   PowerDbgSend-Command\n<\/p>\n<p>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:\n<\/p>\n<p>   Send-PowerDbgCommand\n<\/p>\n<p>Other than that, this stuff is great!  Check out this very cool stuff  <a href=\"http:\/\/blogs.msdn.com\/debuggingtoolbox\/archive\/2007\/09\/05\/powershell-script-powerdbg-using-powershell-to-control-windbg.aspx\">HERE<\/a>.\n<\/p>\n<p>Jeffrey Snover [MSFT]<br \/>Windows Management Partner Architect<br \/>Visit the Windows PowerShell Team blog at:    <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a><br \/>Visit the Windows PowerShell ScriptCenter at:  <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a>\n\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/7271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=7271"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/7271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=7271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=7271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=7271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}