Home > download script, learning, powershell, sql > Download the MCM Readiness Videos with PowerShell

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

Categories: download script, learning, powershell, sql Tags:
  1. learningsql
    December 15th, 2010 at 21:18 | #1

    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.

  2. Jason
    December 15th, 2010 at 21:50 | #2

    Excellent script

  3. CFRandall
    December 16th, 2010 at 10:37 | #3

    Thanks for this.

  4. Murali
    December 18th, 2010 at 11:27 | #4

    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

  5. Eric H
    December 18th, 2010 at 11:37 | #5

    Murali, you might want to start here first. http://technet.microsoft.com/en-us/library/ee177003.aspx. You'll need to look into Set-ExecutionPolicy

  6. dyfhid
    December 18th, 2010 at 20:01 | #6

    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

  7. Murali
    December 19th, 2010 at 07:14 | #7

    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
    **************************

  8. Eric H
    December 19th, 2010 at 11:49 | #8

    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.

  9. Eric H
    December 19th, 2010 at 11:51 | #9

    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.

  1. No trackbacks yet.