«

»

Print this Post

Powershell script to search for “How Do I”-video’s for NAV 2013 (R2)

As you might know, lately, I have been working on the “How Do I”-video-series about various topics regarding Microsoft Dynamics NAV 2013. these video’s are posted on MSDN, PartnerSource and Youtube. (And hereby, you got the links to easily find them – bookmark them, please :-)).

Now, as you migth have noticed, me personally, I have been doing some video’s on Powershell. Namely:

And there are a number of other video’s where I use powershell as well (managing companies,managing users,migrating to multi-tenancy, …).

PowerShell.com

When I started out with powershell, a colleague pointed me to the site: http://powershell.com/cs/ . I immediately joined, and never regreted ever since. You can subscribe to the “PowerTip of the day” with very useful tips .. that really get you going in certain domains .. to do some really clever powershell stuff. Remember that there is PowerShell capabilities in Windows 8 as well! And as Freddy would call it: PowerShell is “Bat-files on steroids..” .. I really like that expression!

Nevertheless, Powershell.com really helped me in the entire NAV-on-PowerShell story as well.

Find YouTube video’s with PowerShell

Not too long ago, I received this PowerTip: Search and View powerShell video’s. Well, isn’t that just perfect? A PowerShell script to find video’s to get you started with PowerShell.. .

Well .. this deserved some modification to provide you a way to search for video’s on NAV 2013 :-). I modified some bits and bytes of the script, to find the “How Do I”-video’s that Microsoft posts on youtube in its channel. Here you go:

When you look at it closely .. you’ll notice it’s quite an interesting example on how to use piping in powershell, isn’t it? In fact, except from the variable declaration, it’s just a oneliner! It’s generally going to use the RSS feed of youtube, filter it on Microsoft’s channel, take as many results as possible (couldn’t get more then 50), put that into a grid, and make it possible for you to select on, click OK and start the video!

The result will be a grid like this, where you can select a movie, which will start playing after you clicked “OK”


How cool is that? 🙂

Ok ok, I admit, it’s a bit playing around with PowerShell .. and you must be wondering how this would be useful to you. Well, if you just put the script into a textfile, call it “HowDoI.ps1”, and place it somewhere where you can easily find it (desktop?) .. then you always have it by hand:


The feed

At least, that’s what I do now .. :-). Another way to easily go to the How Do I video’s is obviously the same feed that I’m using in this powershell script. Which I guess makes sense to share as well ;-):

https://gdata.youtube.com/feeds/api/videos?v=2&q=”How Do I:”+NAV+2013&max-results=50&author=msdyncomm

Now I definitely shared all the ways to get to the How Do I video’s.. hope it finds you well!

Enjoy!

5.00 avg. rating (96% score) - 1 vote

Permanent link to this article: http://www.waldo.be/2014/02/03/powershell-in-the-how-do-i-series-for-nav-2013-r2/

2 comments

5 pings

  1. Magno

    In some cases, there is a bug in the invoke-restmethod. Then only every other row is returned instead of all rows.
    (https://connect.microsoft.com/PowerShell/feedback/details/691723/ps3ctp1-invoke-restmethod-fails-to-return-the-entire-output)

    Microsoft suggests to use the invoke-webrequest method instead. So below is an updated version of your script for anyone who is interested.

    $keyword = ‘”How Do I:”+NAV+2013′
    $url = “https://gdata.youtube.com/feeds/api/videos?v=2&q=$($keyword)&max-results=50&author=msdyncomm”

    $wc = New-Object Net.WebClient
    [xml]$xml=$wc.DownloadString($url)
    $xml.feed.entry |
    Select-Object -Property Title, @{N=’Author’;E={$_.Author.Name}}, @{N=’Link’;E={$_.Content.src}}, @{N=’Updated’;E={[DateTime]$_.Updated}}, @{N=’Views’;E={$_.Statistics.viewCount}} |
    Sort-Object -Property Updated -Descending |
    Out-GridView -Title “Select your ‘$Keyword’ video, then click OK to view.” -PassThru |
    ForEach-Object { Start-Process $_.Link }

    Regards,
    Joachim

    1. waldo

      Thanks, dear colleague ;-).

  1. Powershell script to search for “How Do I”-video’s for NAV 2013 (R2) | Pardaan.com

    […] Bron : Waldo’s Blog Lees meer… […]

  2. New How-Do-I Video’s on Microsoft Dynamics NAV 2013 R2 » waldo's blog

    […] me, the powershell that I wrote works pretty well, as it’s sorting on the release date: I immediately see the new ones on […]

  3. New How-Do-I Video’s on Microsoft Dynamics NAV 2013 R2 - Waldo's Blog Microsoft Dynamics NAV - Microsoft Dynamics NAV - Microsoft Dynamics Community

    […] me, the powershell that I wrote works pretty well, as it’s sorting on the release date: I immediately see the new ones on […]

  4. New How-Do-I Video’s on Microsoft Dynamics NAV 2013 R2 - Microsoft Dynamics NAV Community

    […] me, the powershell that I wrote works pretty well, as it’s sorting on the release date: I immediately see the new ones on […]

Leave a Reply

%d bloggers like this: