Get output to show in the webpage #1658
Unanswered
dennisa72295
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Pode 2.12.1 and pode.web 1.0.0 along with pendingreboot 0.9.0.6 modules. When I run my script and click on the run report button, I get no output to the screen at all, even when there are no results. What am I missing? This is the script:
Import-Module Pode
Import-Module Pode.Web
import-module pendingreboot
--- LOGIC BLOCK 1: THE SCAN ---
$ScanLogic = {
# 1. RESET THE UI IMMEDIATELY
# This acts as a "Keep-Alive" for the browser connection
Update-PodeWebComponent -Id 'ReportOutput' -Content {
New-PodeWebText -Value "Scan in progress... please wait." -Colour Blue
}
}
--- LOGIC BLOCK 2: THE REBOOT ---
$RebootLogic = {
$srv = $WebEvent.Data.ServerName
$time = $WebEvent.Data.RebootTime
try {
$dt = [DateTime]::Parse($time)
Invoke-Command -ComputerName $srv -ScriptBlock {
param($T)
$action = New-ScheduledTaskAction -Execute 'shutdown.exe' -Argument '/r /t 0 /f'
$trigger = New-ScheduledTaskTrigger -At $T -Once
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "PodeReboot" -User "System" -Force
} -ArgumentList $dt -ErrorAction Stop
}
--- SERVER START ---
Start-PodeServer {
Add-PodeEndpoint -Address 127.0.0.1 -Port 8080 -Protocol Http
Use-PodeWebTemplates -Title 'Server Monitor'
}
Beta Was this translation helpful? Give feedback.
All reactions