jg1000c
November 12, 2021, 9:54pm
1
I haven’t had much luck getting things to run. Any idea why the code below won’t run? I get the attached error.
Stop all dashboards
Get-UDDashboard | Stop-UDDashboard
Grid
$PowerShellModuleFilesGrid = New-UdGrid -Title “PowerShell Module files” -Endpoint {
get-childitem -Path ‘C:\Program Files\WindowsPowerShell\Modules’ -Recurse | Select-Object -Property Name, Length | Out-UDGridData
} -AutoRefresh -RefreshInterval 5
The dashboard
$Dashboard1 = New-UDDashboard -Title “Servers dashboard” -Content{
# Dashboard layout
New-UDLayout -Columns 1 -Content {
$PowerShellModuleFilesGrid
}
}
Starting the dashboard
Start-UDDashboard -Port 5000 -Name “Servers” -Dashboard $Dashboard1
$files = get-childitem -Path ‘C:\Program Files\WindowsPowerShell\Modules’ -Recurse | Select-Object -Property Name, Length
Product: PowerShell Universal
Version: 2.5
adam
November 12, 2021, 10:03pm
2
Can you let me know where you found this example code? It’s from the old Universal Dashboard v2 but it looks like you are running PowerShell Universal.
The table has replaced the grid.
No need to call start dashboard or anything. That’s all managed in the admin console.
1 Like
jg1000c
November 12, 2021, 10:41pm
3
Gotcha, I bought the Powershell Universal Dashboard course on Udemy.
jg1000c
November 12, 2021, 10:47pm
4
One thing that is driving me nuts is the copy code functionality is not working. I go to paste and it doesn’t work. Even highlighting the code only works line by line.
jg1000c
November 12, 2021, 11:06pm
5
What is wrong with this code? It should run right?
jg1000c
November 12, 2021, 11:09pm
6
More examples that don’t work
jg1000c
November 13, 2021, 2:41am
7
I did get this to work:
New-UDDashboard -Title “Hello, World!” -Content {
New-UDDynamic -Id 'table' -Content {
$Data = Get-Process
New-UDTable -Data $Data -Paging
} -LoadingComponent {"Loading"}
New-UDButton -Text 'Refresh Table' -OnClick {
Sync-UDElement -Id 'table'
}
$names = get-childitem | Select-Object Name
foreach($name in $names ){
$name
}
New-UDTable -Data $Names
}
jg1000c
November 13, 2021, 7:18pm
8
The copy works in Safari but doesn’t in Firefox on Mac.
adam
November 15, 2021, 3:16pm
9
I can open a case with GitBook as they are the service we use for the docs.
1 Like