Sign inSign up

tinuwalther/pode

By tinuwalther

Updated about 2 years ago

This is an example for using pode and PSHTML in a docker container

Image
Web servers
0

340

tinuwalther/pode repository overview

Docker

This is an example for using pode and PSHTML in a docker container. Pode and PSHTML are cross platform powershell modules, Pode is the Web server and PSHTML is a module that allows to renders HTML using powershell syntax.

This is an Almalinux 9 image with PowerShell v7.4 and Pode, PSHTML, PsNetTools, mySQLite and Pester installed.

Pull the image

To pull the image, you can use the following command:

docker pull tinuwalther/pode:latest

Run the container

To run the container, you can use the following command:

docker run -e TZ="Europe/Zurich" --hostname pshtml --name podepshtml -p 8080:8080 -d tinuwalther/pode

Website

Now try navigating to http://localhost:8080 and you should see a beautiful website.

REST API

Open a Terminal and execute the following commands to update the pages:

# Update the Index-Page
Invoke-WebRequest -Uri http://localhost:8080/api/index -Method Post

# Update the Pode-Page
Invoke-WebRequest -Uri http://localhost:8080/api/pode -Method Post

# Update the Asset-Page
Invoke-WebRequest -Uri http://localhost:8080/api/asset -Method Post

# Execute the PesterTests and update the Pester-Page
Invoke-WebRequest -Uri http://localhost:8080/api/pester -Method Post -Body '["sbb.ch","admin.ch","ubs.com"]'

# Update the SQLite-Page with the SQL-Statement you run
Invoke-WebRequest -Uri http://localhost:8080/api/sqlite  -Method Post -Body 'SELECT * FROM "classic_ESXiHosts" ORDER BY Notes Desc Limit 5'

# Update the Mermaid-Page with the SQL-Statement you run
Invoke-WebRequest -Uri http://localhost:8080/api/mermaid -Method Post -Body 'SELECT * FROM "classic_ESXiHosts" ORDER BY HostName'

# Update the Help-Page
Invoke-WebRequest -Uri http://localhost:8080/api/help -Method Post

Tag summary

Content type

Image

Digest

sha256:bded3a2c8

Size

261.7 MB

Last updated

about 2 years ago

docker pull tinuwalther/pode