요즘 Pode.Web 모듈이 심상치 않습니다. 간단한 Powershell Code로 괜찮은 아웃풋을 내고 있습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| Import-Module Pode
Import-Module Pode.Web
Start-PodeServer {
# add a simple endpoint
Add-PodeEndpoint -Address localhost -Port 8090 -Protocol Http
# set the use of templates
Use-PodeWebTemplates -Title 'Basic Example'
# set the home page elements (just a simple paragraph)
$section = New-PodeWebCard -Name 'Welcome' -NoTitle -Content @(
New-PodeWebParagraph -Value 'This is an example homepage, with some example text'
New-PodeWebParagraph -Value 'Using some example paragraphs'
)
Set-PodeWebHomePage -Layouts $section -Title 'Awesome Homepage'
# add a page to search process (output as json in an appended textbox)
$form = New-PodeWebForm -Name 'Search' -AsCard -ScriptBlock {
Get-Process -Name $WebEvent.Data.Name -ErrorAction Ignore | Select-Object Name, ID, WorkingSet, CPU | Out-PodeWebTextbox -Multiline -Preformat -AsJson
} -Content @(
New-PodeWebTextbox -Name 'Name'
)
Add-PodeWebPage -Name Processes -Icon Activity -Layouts $form
}
|
앞으로 어떻게 될 지 알 수 없습니다만, 주목해 볼 만 합니다.
ref