자바스크립트를 활성화 해주세요

p077 요즘 Pode.Web 모듈 움직임을 주목하고 있습니다

 ·  ☕ 1 min read

요즘 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
}

p077_podeweb_powershell.png

앞으로 어떻게 될 지 알 수 없습니다만, 주목해 볼 만 합니다.

p077_podeweb_browser.png

ref

공유하기

tkim
글쓴이
tkim
Software Engineer