Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adamdriscoll/869ec9321cbc0c186fe3c214475a857c to your computer and use it in GitHub Desktop.
Save adamdriscoll/869ec9321cbc0c186fe3c214475a857c to your computer and use it in GitHub Desktop.
Finds schedule modules using a scheduled endpoint
Import-Module UniversalDashboard
$Schedule = New-UDEndpointSchedule -Every 10 -Minute
$Endpoint = New-UDEndpoint -Schedule $Schedule -Endpoint {
$Cache:Modules = Find-Module *SQL* | ForEach-Object {
[PSCustomObject]@{
Name = $_.Name
Version = $_.Version
Downloads = $_.AdditionalMetadata.downloadCount
}
}
}
$Dashboard = New-UDDashboard -Title "SQL Modules" -Content {
New-UDTable -Title 'SQL Modules' -Headers @("Name", "Version", "Downloads") -Endpoint {
$Cache:Modules | Out-UDTableData -Property @("Name", "Version", "Downloads")
}
}
Start-UDDashboard -Dashboard $Dashboard -Port 10000 -Endpoint $Endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment