Created
April 20, 2018 04:05
-
-
Save adamdriscoll/869ec9321cbc0c186fe3c214475a857c to your computer and use it in GitHub Desktop.
Finds schedule modules using a scheduled endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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