David's profileDavid Moisan's ITPhotosBlogLists Tools Help
    May 24

    Generating crash dump reports with PowerShell

    I've been using the new Windows scripting language PowerShell.  I've also been having a lot of problems with my workstation;  ever since I found my machine overheating--due to old, slow fans, it's never been the same since, averaging a crash a day.  Is it just the hardware?  Is it a bad driver?  Did I just not seat the cards correctly last time I opened it?
     
    I use Microsoft's Debugging Tools For Windows to diagnose crashes for SATV's servers and other machines and I was getting tired of going to WinDbg and putting in the same commands every time I needed to look at a crash dump.
     
    Here's my first PowerShell script, a simple wrapper for KD, the command line debugger.
     
    # crashreport.ps1
    # Create debug analysis logs using KD
    # D. Moisan 5/24/2006
    #
    # Usage: crashreport <dumpfile>
    #
    # Input: <dumpfile> can be a full memory dump, kernel dump or minidump
    #
    # Output: Log file to standard output
    #
    # Note:  Debugging Tools for Windows must be installed
    # in its default directory (Program Files\Debugging Tools For Windows)
    #
    if ($Args.Count -eq 0) {
       "Usage: crashreport <dumpfile>"
       exit }
    set-alias kd $Env:ProgramFiles"\Debugging Tools For Windows\kd.exe"
    # Debug commands are specified here.  See the Debugging Tools For
    # Windows for more details
    #
    # Commands are:  !analyze -v    Verbose analysis of the crash
    #                kv             Stacktrace
    #                !process       Current process and thread at crash
    #                lmf            List loaded modules and file paths
    #                q              quit KD (or else KD will keep running)
    #
    $debugcommands = "`"!analyze -v; kv; !process; lmf; q`""
    "Using debug commands: " + $debugcommands
    "Generating debug output"
    $crashdumpfile = $Args[0]
    "Using crash dump file: " + $crashdumpfile
    # Execute kd with commands
    kd -c $debugcommands -noshell -z $Args[0]
    "Debug Output to log file: " + $debugoutputfile
    "Done!"
    exit
     
     
    Take care,
     
    Dave
     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://dmoisan.spaces.live.com/blog/cns!95CB015E3E4A702A!126.trak
    Weblogs that reference this entry
    • None