Skip to content

Instantly share code, notes, and snippets.

@devlead
Last active August 29, 2015 13:57
Show Gist options
  • Save devlead/9811507 to your computer and use it in GitHub Desktop.
Save devlead/9811507 to your computer and use it in GitHub Desktop.
Get all high quiality azure friday episodes for Build trip
$(Invoke-RestMethod -Uri http://channel9.msdn.com/Shows/Windows-Azure-Friday/feed/mp4high)|%{$pattern = "[{0}]" -f ([Regex]::Escape( [System.IO.Path]::GetInvalidFileNameChars() -join '' )); @{ FileName = [RegEx]::Replace($_.title + ".mp4", $pattern, ''); Url=@($_.group.content.url |sls high.mp4)[0].ToString()} }|%{if(!(Test-Path -Path $_.FileName )){Invoke-WebRequest -Uri $_.Url -OutFile $_.FileName}}
@devlead
Copy link
Author

devlead commented Mar 27, 2014

Added check for if file name exists and clean file name of invalid characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment