Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube Downloader Prompting Wrapper : wraps youtube-dl.exe for a start-menu icon that prompts for the url to download.
param( [Parameter(Mandatory=$true)][string]$UrlToDownload )
$downloadDirectory="C:\Users\Services\Downloads"
cd $downloadDirectory
write-host ""
write-host ""
write-host "Downloading $urlToDownload to $downloadDirectory ..."
write-host ""
write-host ""
$Error.Clear()
youtube-dl.exe $urlToDownload
if($Error){
start youtube-dl -verb Runas -ArgumentList "-U"
Write-Warning "======================================================="
Write-Warning "The youtube downloader has to update first."
Write-Warning "Please try again after the update has run."
Write-Warning "======================================================="
pause
} else {
write-host ""
write-host ""
ls | where {$_.LastWriteTime -gt [DateTime]::Today}
write-host ""
start-process $downloadDirectory
}
@chrisfcarroll

This comment has been minimized.

Copy link
Owner Author

chrisfcarroll commented Jul 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.