October 21st, 2013

PowerTip: Search for YouTube Videos

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to search YouTube videos. Hey, Scripting Guy! Question How can I search for YouTube videos about Desired State Configuration in Windows PowerShell 4.0?

Hey, Scripting Guy! Answer Use Invoke-RestMethod:

Invoke-RestMethod -uri “https://gdata.youtube.com/feeds/api/videos?v=2&q=Desired+State+Configuration+PowerShell” 

The following command lists each video by title, author, and link:

Invoke-RestMethod -uri “https://gdata.youtube.com/feeds/api/videos?v=2&q=Desired+State+Configuration+PowerShell” |
foreach {[PSCustomObject]@{Title=$_.Title; Author=$_.author.name; Link=$_.content.src}} | Format-List

Prefer a function for your profile?

function Get-DSCVideos {

Invoke-RestMethod -uri “https://gdata.youtube.com/feeds/api/videos?v=2&q=Desired+State+Configuration+PowerShell” |
foreach {[PSCustomObject]@{Title=$_.Title; Author=$_.author.name; Link=$_.content.src}} | Format-List }  

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.