In June of this year PowerShell Conference Europe 2020 will be taking place in Hannover, Germany. There will be over 70 sessions of fantastic PowerShell content. One of the sessions will be on Universal Dashboard. In this post, I’ll show you how to build a calendar of the sessions using the same technology we will be demonstrating in Europe this summer.
Creating a Calendar with Universal Dashboard
Using the react-big-calendar control, I’ve created a Universal Dashboard component that you can use in your websites. First, you’ll need to install UniversalDashboard and UniversalDashboard.Calendar.
Install-Module UniversalDashboard Install-Module UniversalDashboard.Calendar
Next, we will need to pull the session list for PowerShell Conference Europe. This can be done using Invoke-RestMethod.
Invoke-RestMethod http://powershell.fun
Now, we will need to transform the property names from the Invoke-RestMethod call to match the ones expected by the UDCalendar component. The calendar component supports a title, description, start and end dates for events.
$Sessions = Invoke-Restmethod http://powershell.fun | ForEach-Object {
@{
title = $_.Name
desc = $_.Speaker + [Environment]::NewLine + $_.Description
start = $_.Starts
end = $_.Ends
}
}
Finally, we need to pass the $Sessions variable to the -Events property of New-UDCalendar.
New-UDCalendar -Events $Sessions
We can put all this code within a new dashboard and start it up on port 10000. Navigate in your web browser to the page and you’ll see a handy list of events in either Weekly, Daily or Agenda view.
Start-UDDashboard -Dashboard (
New-UDDashboard -Title "PowerShell Conference Europe 2020 -Content {
$Sessions = (Invoke-Restmethod http://powershell.fun) | ForEach-Object {
@{
title = $_.Name
desc = $_.Speaker + [Environment]::NewLine + $_.Description
start = $_.Starts
end = $_.Ends
}
}
New-UDCalendar -Events $Sessions
}) -Port 10000
Want to contribute to the UDCalendar control? Visit the GitHub page.
