#PSTip Explore TechEd NA 2014 sessions with PowerShell

TechEd North America 2014 has a nice Content Catalog page. It provides a few useful search criteria to filter the content and find the sessions you are mostly interested in. That’s great, but I wanted to search the content catalog using PowerShell. While we wait for TechEd team to make the content catalog available as an OData web service, we can try to scrap the needed information about sessions from the Content Catalog page.

At first, I’ve tried to fetch the page with the Invoke-WebRequest cmdlet and use the ParsedHtml property and GetElementsByTagName() method, but that was painfully slow. Then I’ve remembered that I have friends, Tobias and Jakub, who are very good with Regular Expressions. Regular Expressions are an esoteric art and difficult to get right, but, luckily, these two guys know their RegEx.

Another challenge was the way how authors of the Content Catalog page deal with the paging. By default, you will get results in the chunks of 10 per result page. With some help of browser’s developer tools, Jakub’s found out we can modify the URL using the “take” parameter and ask for more (there are 600+ session, so we used “take=1000” to get them all).

At the end, we output a custom PowerShell object with sessions’ details and wrap it as a reusable Search-TechEdNA2014ContentCatalog function:

Like this:

About Aleksandar Nikolic

Aleksandar is a PowerShell MVP and a co-founder of PowerShell Magazine. He is a frequent speaker at the conferences and participates regularly in IT Pro user groups worldwide. Recently, Aleksandar co-authored the highly respected Administrator’s Guide to Windows PowerShell Remoting. Follow him on Twitter at @alexandair