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
$Dashboard = New-UDDashboard -Title $Title -Content { | |
New-UDGrid -Headers $headers -Properties $Properties -Endpoint { | |
$FormattedItems | Out-UDGridData | |
} | |
} | |
Get-UDDashboard -Name "OutUDGridView" | Stop-UDDashboard |
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
$Schedule = New-UDEndpointSchedule -Every 1 -Second | |
$EverySecond = New-UDEndpoint -Schedule $Schedule -Endpoint { | |
$Cache:ModuleCount = (Get-Module -ListAvailable).Count | |
} | |
$moduleCount = New-UDEndpoint -Url "/moduleCount" -Endpoint { | |
(Get-Module -ListAvailable).Count | |
} |
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 | |
$Dashboard = New-UDDashboard -Title "SQL Modules" -Content { | |
New-UDTable -Title 'SQL Modules' -Headers @("Name", "Version", "Downloads") -Endpoint { | |
Find-Module *SQL* | ForEach-Object { | |
[PSCustomObject]@{ | |
Name = $_.Name | |
Version = $_.Version | |
Downloads = $_.AdditionalMetadata.downloadCount | |
} |
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 | |
} |
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
$Root = New-UDTreeNode -Name 'FileSystem' -Id 'FileSystem' | |
New-UDTreeView -Node $Root -OnNodeClicked { | |
param($Body) | |
$Obj = $Body | ConvertFrom-Json | |
if ($Obj.NodeId -eq 'FileSystem') { | |
Get-PSDrive -PSProvider FileSystem | ForEach-Object { | |
New-UDTreeNode -Name $_.Root -Id $_.Root | |
} |
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
New-Installer -ProductName "Notepad" -UpgradeCode c5b5bcbb-a94f-4490-9746-7563a454357f -OutputDirectory $PSScriptRoot -Content { | |
New-InstallerDirectory -PredefinedDirectoryName AppDataFolder -Content { | |
New-InstallerDirectory -DirectoryName "Notepad" -Content { | |
New-InstallerFile -Source (Join-Path $PSScriptRoot "notepad.ps1") -Id "Notepadps1" | |
} | |
} | |
} -CustomAction @( | |
New-InstallerCustomAction -FileId "Notepadps1" -RunOnInstall -CheckReturnValue | |
) |
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 | |
Get-UDDashboard | Stop-UDDashboard | |
$EI = New-UDEndpointInitialization -Module (Join-Path $PSScriptRoot 'influxdb.psm1') | |
$Cache:NetworkStats = @( | |
'\network adapter(*)\bytes received/sec' | |
'\network adapter(*)\bytes sent/sec' | |
) |
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
function Get-InfluxDb { | |
param( | |
[Parameter()] | |
$Url = 'http://localhost:8086/query?db=performance_data', | |
[Parameter()] | |
$Query | |
) | |
$Results = Invoke-RestMethod -Uri "$Url&q=$Query" |
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 stripJsonComments = require('strip-json-comments'); | |
var workbenchSettings = vscode.workspace.getConfiguration("workbench"); | |
var theme = workbenchSettings.colorTheme; | |
var themePath = null; | |
var extension = vscode.extensions.all.find(x => { | |
var extensionTheme = x.packageJSON.contributes.themes && x.packageJSON.contributes.themes.find(y => { | |
return y.label === theme; | |
}); |
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 "F:\universal-dashboard\src\UniversalDashboard\bin\Debug\UniversalDashboard.Community.psd1" | |
$ViewModel = New-UDViewModel -Name "Home" -Members @{ | |
Text = 1 | |
Icon = 'user' | |
Click = New-UDEndpoint -Endpoint { | |
$this.Text++ | |
$this.Icon = 'group' | |
} | |
Clear = New-UDEndpoint -Endpoint { | |
$this.Text = 0 |