Using PowerShell to get data for Microsoft Ignite

I was registered for Ignite yesterday (yipeeee!!), and decided to take a look at the session list. 

Navigation and search is a bit of a chore, so I set out to see if I could get the information I needed via PowerShell. If so, I was free to obtain whatever data wanted quickly.

Here’s what i came up with. After the script a couple of examples of post querying the data are given. Note that instead of querying the web services each time for data, I’ve just downloaded all the data, and query it locally. This isn’t really best practice, but (IMO) the low size of the dataset mitigates this to some extent.

Recommendations for improving or additions are more than welcome. 🙂 It will be posted to GitHub shortly.





6 thoughts on “Using PowerShell to get data for Microsoft Ignite

  1. Pretty cool!
    Here I made some minor changes if you want to incorporate.
    Builds a Progress Bar instead
    Returns the data object to the screen for consumption 🙂

    #Now parse through each page, converting to JSON. Once converted, add the result data to the data array
    For ($page = 1;$page -le $PageCount;$page++)
    $searchbody = “{"searchText“:"*“,"searchPage“:$($page),"sortOption“:"None“,"searchFacets“:{"facets“:[],"personalizationFacets“:[]}}”
    $searchResults = Invoke-WebRequest -Uri “$($web.baseURL)/$($web.searchURL)” -Body $searchbody -Method Post -ContentType $web.contentType -UserAgent $web.userAgent -WebSession $session
    $sessiondata = ConvertFrom-Json -InputObject $searchResults
    [array] $data += $

    # Calculate Percentage Complete
    [int]$Pct=[int](($page / $PageCount) * 100)

    # Display Progress Bar
    Write-Progress -Activity “Building Ignite Content” -CurrentOperation “Pulling Data from Microsoft” -PercentComplete $Pct -Status “$Pct % Completed”
    # Return data object for Consumption

    The Energized Tech
    Honorary Scripting Guy

Leave a Reply to Tim Pringle Cancel reply

Your email address will not be published. Required fields are marked *