PowerShell Script to Download SQL MCM Videos

You may also like...

25 Responses

  1. Shawn Melton says:

    Downloading them using this script to my work laptop and works like a champ. Downloaded the script and opened in the ISE on a Windows XP SP3 machine, changed the file path and away it goes.


  2. David Dye says:

    AWESOME!! Thanks for sharing!! Worked as is for me!

  3. BigFishSQL says:

    Excellent. Must figure out how to write these myself.

    • Aaron Nelson says:

      Thanks! I have a bunch of examples on here for all kinds of stuff. This script was surprisingly easy to write but it was the RegEx portion that slowed me down. I will post a “How I did this” post next week.

  4. Jack Corbett says:

    Had an error when I cut and paste the code when using Chrome, but worked fine when I cut and paste using IE.

  5. Denny Cherry says:

    I was using FF 3.6.13 when I grabbed the script and it didn’t work correctly.


  6. Oscar Zamora says:

    Using crhome here. Opened a PS window, copied, pasted and voila.

    Thanks for sharing!

    • Aaron Nelson says:

      Thanks for the feedback about Chrome Oscar. Good to know that it’s working for some people with Chrome. Maybe it’s a “culture” issue and just doesn’t speak “Palm Tree” 😉

  7. Pat Wright says:

    Thanks so much for this it’s a huge help! 🙂

  8. Jack Corbett says:


    I use Chrome.

    I got all the videos downloaded overnight. It took about 6 hours over my internet connection.

  9. Denny Cherry says:

    I grabbed the fixed server and all was well with the world. You know, after I changed the path and told it to download the mp4 version for my iPad. 🙂

    • Aaron Nelson says:

      Thanks for the update. It’s not so much fixed as it’s just not rendered. I’m just not a expert when it comes to HTML tags. Which browser were you using? I tried it in IE yesterday and it worked fine.

  10. Jack Corbett says:

    Script works fine.

    Just make sure you download the file from the PowerShell Script link. Copy and paste didn’t work for me, I got a regex error.

  11. Frank says:

    Thanks Aaron,

    the script you sent me works fine now!
    You did a great job! 🙂

    Keep it real that way, my friend!


  12. Dugi says:

    WoW! It’s very nice script, thanks!

  13. Sean says:

    Thanks!!! saved me a lot of time..
    I had to change execution policy though before windows allowed me execute it.

  14. Steve Jones says:

    Thanks, Aaron! This worked great for me.

  15. Just a quick note, if you change the file pattern to “(?[^>]*?mp4))” It grabs the ipod compatible mp4, since it’s the first in the list. (at least it appears to). This is yet another reason I need to upgrade my scripting skills from bash to powershell. I’ve been in windows longer than linux, but I still haven’t committed the time to learn. Thank you for giving me just one more reason!

    • Aaron Nelson says:

      Oh thanks for pointing that out Shannon. I meant to tell everyone that they could swap out wmv for zip, mp4, or any other extension that’s up there.

  16. Frank says:

    Sorry, doesn’t work for me:

    “Exception callling ‘DownloadFile'” “Path has an invalid format.”

    • Aaron Nelson says:

      I made a small update to the post because the HTML wasn’t rendering correctly. Luckily Chad Miller just happened to have the answer to that too.

      I’m not sure if that would have caused the error that you got though. You may want to run this “$home\Videos” and just check to make sure that your Videos directory is in the same location. If that doesn’t work just let me know and I’ll investigate further.

  17. If you get the following error on Windows 7, you may be like me!

    Exception calling “DownloadFile” with “2” argument(s): “An exception occurred during a WebClient request.”
    At line:10 char:29
    + $wc.DownloadFile <<<< ($url,$file)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    I had changed the location of my video directory, and $home\Videos was pointing to a non-existing directory.

    I updated $file so it points to where I actually squirrel these away and it's working just fine now.

    Thanks Aaron and Nic!

    • Aaron Nelson says:

      Oh thanks so much for that Kendra! I keep meaning to do a series on just the error messages since even I can’t understand them at first glance the majority of the time.

  1. 2010.12.20

    […] This post was mentioned on Twitter by Joe Webb, SoftArtisans Team and others. SoftArtisans Team said: Nice little shortcut to SQL MCM-dom: RT @sqlvariant: PowerShell Script to Download SQL MCM Videos: http://bit.ly/f0Vlwc #SQLPASS #SQL […]

  2. 2010.12.21

    […] cool little learning project inspired from Aaron Nelson’s (Blog | Twitter) PowerShell code to download all videos from a site. My SSIS experiment was to take all of those videos, rename them according […]

Leave a Reply to David Dye Cancel reply

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

%d bloggers like this: