Download the MCM Readiness Videos with PowerShell

Microsoft has changed their SQL MCM program to allow more people access to the course and certification. In doing so, they are recording much of the classroom training that was previously required and putting it up on TechNet. We’re talking close to 60 videos already. Sure, you could stream them one at a time, but I wanted to be able to download them all and watch them offline without a bunch of clicking. So I built the below PowerShell scripts. They’re really simple to use, and only have one external requirement that makes dealing with web pages much easier.

You’ll need to download the Html Agility Pack library from here.

Get the script

Usage:

Get urls of all WMV files
>& ‘.\Download MCM Videos.ps1’

Download all WMV files
>& ‘.\Download MCM Videos.ps1’ -download

Download all iPod files
>& ‘.\Download MCM Videos.ps1’ -download -type ipod

9 thoughts on “Download the MCM Readiness Videos with PowerShell

  1. learningsql

    I love this script. Thank you. I have never run, or created a PowerShell script before. I have wanted to figure it out but have never taken the time. It took me about 15 minutes to get everything setup right and whalah (spellig?) IT Ran. I am so pumped. Thanks for the script.

    Reply
  2. Murali

    I am not familar with PS can you please send me the complete steps how to go about. Your help is much appreciated

    Regards
    Murali

    Reply
  3. dyfhid

    Eric,

    I get (apparently 53 times in a row 🙂

    Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
    At C:\users\public\documents\powershell\Download MCM Videos.ps1:43 char:50
    + (New-Object System.Net.WebClient).DownloadFile <<<< ($fileUrl, $fileName)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Reply
  4. Murali

    Hi Eric,

    I get the following Error msg :
    **************************
    You cannot call a method on a null-valued expression.
    At C:\Users\Murali\Desktop\Download MCM Videos.ps1:36 char:22
    + $page = $web.Load <<<< ($_.PSBase.innertext)
    + CategoryInfo : InvalidOperation: (Load:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
    **************************

    Reply
  5. Eric H

    dyfhid, double check your paths. I'm guessing the destination doesn't exist. I'll try to update the script to add checking if the destination path exists.

    Reply
  6. Eric H

    Murali, are you loading the HtmlAgilityPack dll successfully? Remove the | Out-Null from the end of the LoadFile line at the top of the script.

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.