Skip to content

Sample Scripts

SampleAuth

Synopsis

SampleAuth.ps1

Description

Caching

Synopsis

A sample PowerShell script to set up a Pode server and integrate with Redis for caching.

Description

This script sets up a Pode server listening on port 8081 with Redis integration for caching. It checks for the existence of the redis-cli command and sets up a Pode server with routes that demonstrate caching with Redis.

Create-Routes

Synopsis

A sample PowerShell script to set up a Pode server with multiple routes using different approaches.

Description

This script sets up a Pode server listening on port 8081 with various routes demonstrating different approaches to route creation. These include using script blocks, file paths, and direct script inclusion.

Dot-SourceScript

Synopsis

A sample PowerShell script to set up a Pode server and run a script from an external file.

Description

This script sets up a Pode server, enables terminal logging for errors, and uses an external script for additional logic. It imports the Pode module from the source path if available, otherwise from the installed modules.

External-Funcs

Synopsis

A sample PowerShell script to set up a Pode server and use an external module function.

Description

This script sets up a Pode server listening on port 8081, imports an external module containing functions, and includes a route that uses a function from the external module to generate a response.

File-Monitoring

Synopsis

A sample PowerShell script to set up a Pode server with a view engine and file monitoring.

Description

This script sets up a Pode server listening on port 8081, uses Pode's view engine for rendering web pages, and configures the server to monitor file changes and restart automatically.

File-Watchers

Synopsis

A sample PowerShell script to set up a Pode server with file watcher and logging.

Description

This script sets up a Pode server, enables terminal logging for errors, and adds a file watcher to monitor changes in PowerShell script files (*.ps1) within the script directory. The server logs file change events and outputs them to the terminal.

FileBrowser

Synopsis

PowerShell script to set up a Pode server with static file browsing and authentication.

Description

This script sets up a Pode server that listens on port 8081. It includes static file browsing with different routes, some of which require authentication. The script also demonstrates how to set up basic authentication using Pode.

The server includes routes for downloading files, browsing files without downloading, and accessing files with authentication.

HelloWorld

Synopsis

PowerShell script to set up a Pode server with a simple GET endpoint.

Description

This script sets up a Pode server that listens on port 8080. It includes a single route for GET requests to the root path ('/') that returns a simple text response.

IIS-Example

Synopsis

A sample PowerShell script to set up a Pode server with logging and task scheduling.

Description

This script sets up a Pode server listening on port 8081, enables terminal logging for requests and errors, and includes a scheduled task. The server has two routes: one for a simple JSON response and another to invoke a task that demonstrates delayed execution.

Logging

Synopsis

A sample PowerShell script to set up a Pode server with configurable logging, view engine, and various routes.

Description

This script sets up a Pode server listening on port 8081, configures a view engine, and allows for different types of request logging (terminal, file, custom). It includes routes for serving a web page, simulating a server error, and downloading a file.

Looping-Service

Synopsis

A sample PowerShell script to set up a Pode server with interval-based service handlers.

Description

This script sets up a Pode server that runs with a specified interval, adding service handlers that execute at each interval. The handlers include logging messages to the terminal and using lock mechanisms.

Mail-Server

Synopsis

A sample PowerShell script to set up a Pode server with SMTP and SMTPS protocols.

Description

This script sets up a Pode server listening on SMTP (port 25) and SMTPS (with explicit and implicit TLS). It includes logging for errors and debug information and demonstrates handling incoming SMTP emails with potential attachments.

Middleware

Synopsis

A sample PowerShell script to set up a Pode server with rate limiting and middleware.

Description

This script sets up a Pode server listening on port 8081 with various middleware implementations and rate limiting for incoming requests. It includes middleware for route-specific logic, blocking specific user agents, and rejecting requests from certain IP addresses.

OneOff-Script

Synopsis

A simple PowerShell script to set up a Pode server and log a message.

Description

This script sets up a Pode server, enables terminal logging for errors, and writes a "hello, world!" message to the terminal. The server runs the logic once and then exits.

OpenApi-SimplePotato

Synopsis

Sets up a Pode server with OpenAPI documentation, request logging, and routes for handling 'potato' requests.

Description

This script configures a Pode server to listen on a specified port, enables both request and error logging, and sets up OpenAPI documentation. It defines routes for fetching 'potato' data with responses in both JSON and plain text. OpenAPI documentation is exposed via Swagger and other viewers.

OpenApi-TuttiFrutti

Synopsis

A sample PowerShell script to set up a Pode server with OpenAPI 3.0 and 3.1 specifications.

Description

This script sets up a Pode server listening on ports 8081 and 8082 with OpenAPI 3.0 and 3.1 specifications. It includes multiple endpoints, OpenAPI documentation, various route definitions, authentication schemes, and middleware for enhanced API functionality.

Petstore-OpenApi

Synopsis

PowerShell script to set up a Pode server for a Pet Store API using OpenAPI 3.0 specifications.

Description

This script sets up a Pode server that listens on a specified port and uses OpenAPI 3.0 specifications for defining the API. It supports multiple endpoints for managing pets, orders, and users with various authentication methods including API key, Basic, and OAuth2.

This example shows how to use session persistent authentication using Windows Active Directory. The example used here is Form authentication, sent from the

in HTML.

Navigating to the 'http://localhost:8081' endpoint in your browser will auto-redirect you to the '/login' page. Here, you can type the details for a domain user. Clicking 'Login' will take you back to the home page with a greeting and a view counter. Clicking 'Logout' will purge the session and take you back to the login page.

Petstore-OpenApiMultiTag

Synopsis

Sets up a Pode server for a Pet Store API with OpenAPI 3.0 and 3.1 specifications.

Description

This script configures a Pode server to serve a Pet Store API using OpenAPI 3.0 and 3.1 specifications. It includes multiple endpoints for managing pets, orders, and users, with support for different authentication methods such as API key, Basic, and OAuth2. The server also supports session persistent authentication using Windows Active Directory and provides OpenAPI documentation viewers.

Schedules-CronHelper

Synopsis

A sample PowerShell script to set up a Pode server with HTTP endpoints and a scheduled task.

Description

This script sets up a Pode server listening on port 8081 with a scheduled task that runs every 2 minutes. It includes an endpoint for GET requests.

Schedules-LongRunning

Synopsis

A sample PowerShell script to set up a Pode server with multiple scheduled tasks.

Description

This script sets up a Pode server listening on port 8081 with multiple scheduled tasks. Each task runs every minute and sleeps for a random duration between 5 and 40 seconds. The maximum concurrency for schedules is set to 30.

Schedules-Routes

Synopsis

A sample PowerShell script to set up a Pode server with dynamic schedule creation.

Description

This script sets up a Pode server listening on port 8081 with the ability to create new schedules dynamically via an API route. The server is configured with schedule pooling enabled, and includes an endpoint to create a new schedule that runs every minute.

Schedules

Synopsis

A sample PowerShell script to set up a Pode server with various scheduled tasks.

Description

This script sets up a Pode server listening on port 8081 with multiple schedules configured. It demonstrates scheduling using predefined cron expressions, schedules from files, multiple cron expressions, and scheduling at specific times. Additionally, it includes a route to invoke a schedule's logic ad-hoc with arguments.

ServerFrom-File

Synopsis

A sample PowerShell script to set up a basic Pode server.

Description

This script sets up a Pode server using a server definition from an external script file. The server listens on port 8081, logs errors to the terminal, uses the Pode view engine, and includes a timer and a route for HTTP GET requests.

Shared-State

Synopsis

A sample PowerShell script to set up a Pode server with state management and logging.

Description

This script sets up a Pode server that listens on port 8081, logs requests and errors to the terminal, and manages state using timers and routes. The server initializes state from a JSON file, updates state periodically using timers, and provides routes to interact with the state.

Swagger-Editor

Synopsis

Sets up a Pode server to serve the Swagger editor and static files.

Description

This script configures a Pode server to listen on a specified port (default is 8081) and serve the Swagger editor and other static files. It enables request and error logging and sets up a view engine for rendering HTML.

Tasks

Synopsis

A sample PowerShell script to set up a Pode server with task management and logging.

Description

This script sets up a Pode server that listens on port 8081, logs errors to the terminal, and handles both synchronous and asynchronous tasks. The server provides routes to interact with the tasks and demonstrates task invocation and waiting.

Tcp-Server

Synopsis

A PowerShell script to set up a Pode TCP server with multiple endpoints and error logging.

Description

This script sets up a Pode TCP server that listens on multiple endpoints, logs errors to the terminal, and handles incoming TCP requests with specific verbs. The server provides handlers for 'HELLO', 'HELLO2', 'HELLO3', 'QUIT', and a catch-all handler for unrecognized verbs. It also demonstrates reading client input and responding accordingly.

Tcp-ServerAuth

Synopsis

A sample PowerShell script to set up a Pode TCP server with role-based access control and logging.

Description

This script sets up a Pode TCP server that listens on port 8081, logs errors to the terminal, and implements role-based access control. The server provides an endpoint that restricts access based on user roles retrieved from a database.

Tcp-ServerHttp

Synopsis

A sample PowerShell script to set up a Pode TCP server with multiple endpoints and error logging.

Description

This script sets up a Pode TCP server that listens on port 8081, logs errors to the terminal, and handles incoming HTTP requests. The server provides a catch-all handler for HTTP requests and returns a basic HTML response.

Tcp-ServerMultiEndpoint

Synopsis

A sample PowerShell script to set up a Pode TCP server with multiple endpoints and error logging.

Description

This script sets up a Pode TCP server that listens on multiple endpoints, logs errors to the terminal, and handles incoming TCP requests with specific verbs. The server provides handlers for 'HELLO' and 'Quit' verbs and a catch-all handler for unrecognized verbs.

Threading

Synopsis

A PowerShell script to set up a Pode server with various lock mechanisms including custom locks, mutexes, and semaphores.

Description

This script sets up a Pode server that listens on a specified port and demonstrates the usage of lockables, mutexes, and semaphores for thread synchronization. It includes routes that showcase the behavior of these synchronization mechanisms in different scopes (self, local, and global). The server provides multiple routes to test custom locks, mutexes, and semaphores by simulating delays and concurrent access.

Timers-Route

Synopsis

A PowerShell script to set up a basic Pode server with timer functionality.

Description

This script sets up a Pode server that listens on a specified port and allows the creation of timers via HTTP routes. It includes a route to create a new timer that runs a specified script block at defined intervals.

Timers

Synopsis

A PowerShell script to set up a Pode server with various timer configurations.

Description

This script sets up a Pode server that listens on a specified port and creates multiple timers with different behaviors. It includes routes to create new timers via HTTP requests and invoke existing timers on demand.

Web-AuthApiKey

Synopsis

A PowerShell script to set up a Pode server with API key authentication and various route configurations.

Description

This script sets up a Pode server that listens on a specified port, enables request and error logging, and configures API key authentication. It also defines a route to fetch a list of users, requiring authentication.

Web-AuthBasic

Synopsis

A PowerShell script to set up a Pode server with sessionless Basic authentication for REST APIs.

Description

This script sets up a Pode server that listens on a specified port, enables sessionless Basic authentication, and provides an endpoint to get user information.

Web-AuthBasicAccess

Synopsis

A PowerShell script to set up a Pode server with basic authentication and role/group-based access control.

Description

This script sets up a Pode server that listens on a specified port, enables request and error logging, configures basic authentication, and sets up role and group-based access control. It defines various routes with specific access requirements.

Web-AuthBasicAdhoc

Synopsis

A PowerShell script to set up a Pode server with adhoc Basic authentication for REST APIs.

Description

This script sets up a Pode server that listens on a specified port, enables basic authentication for a REST API endpoint, and returns user information upon successful authentication. The authentication details are checked on a per-request basis without using session-based authentication.

Web-AuthBasicAnon

Synopsis

A PowerShell script to set up a Pode server with Basic authentication for REST APIs.

Description

This script sets up a Pode server that listens on a specified port, enables basic authentication for a REST API endpoint, and returns user information upon successful authentication. The authentication details are checked on a per-request basis without using session-based authentication.

Web-AuthBasicBearer

Synopsis

A PowerShell script to set up a Pode server with sessionless Bearer authentication for REST APIs.

Description

This script sets up a Pode server that listens on a specified port, enables sessionless Bearer authentication, and provides an endpoint to get a list of users.

Web-AuthBasicClientcert

Synopsis

PowerShell script to set up a Pode server with HTTPS and client certificate authentication.

Description

This script sets up a Pode server that listens on a specified port with HTTPS using a self-signed certificate. It enables client certificate authentication for securing access to the server.

Web-AuthBasicHeader

Synopsis

A PowerShell script to set up a Pode server with session-based Basic authentication for REST APIs.

Description

This script sets up a Pode server that listens on a specified port, enables session-based authentication using headers, and provides login and logout functionality. Authenticated users can access a REST API endpoint to retrieve user information.

Web-AuthDigest

Synopsis

PowerShell script to set up a Pode server with Digest authentication.

Description

This script sets up a Pode server that listens on a specified port and uses Digest authentication for securing access to the server. The authentication details are checked against predefined user data.

Web-AuthForm

Synopsis

Sample script demonstrating session persistent authentication using Pode.

Description

This script sets up a Pode server that listens on localhost:8081 and uses session-based authentication for user logins. The authentication is demonstrated using a simple form where users can log in with predefined credentials (username: morty, password: pickle). Upon successful login, users are greeted on the home page, and the view counter is incremented. Users can log out, which will purge the session and redirect them to the login page.

Web-AuthFormAccess

Synopsis

PowerShell script to set up a Pode server with Form authentication and RBAC access.

Description

This script sets up a Pode server that listens on a specified port and uses Form authentication for securing access to different pages. Role-based access control (RBAC) is also implemented to restrict access to certain pages based on user roles.

Web-AuthFormAd

Synopsis

PowerShell script to set up a Pode server with Form authentication using Windows Active Directory.

Description

This script sets up a Pode server that listens on a specified port and uses Form authentication with Windows Active Directory for securing access to different pages. The home page view counter is stored in the session data, which is persisted across user sessions.

Web-AuthFormAnon

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication for a login system.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication.

Web-AuthFormCreds

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication for a login system.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication. It demonstrates a login system using form authentication, converting credentials into a pscredential object.

Web-AuthFormFile

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication using a user file.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication. It demonstrates a login system using form authentication against a user file.

Web-AuthFormLocal

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication using Windows Local users.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication. It demonstrates a login system using form authentication against Windows Local users.

Web-AuthFormMerged

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication for logins on websites.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication. It demonstrates a login system using form authentication.

Web-AuthFormSessionAuth

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication for logins on websites.

Description

This script sets up a Pode server listening on port 8081 with session persistent authentication. It demonstrates a login system using form authentication and session authentication on the main home page route and form authentication on login.

Web-AuthMerged

Synopsis

A sample PowerShell script to set up a Pode server with combined API key and Basic authentication, as well as role and group-based access control.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to use both API key and Basic authentication, combined together for access control based on roles and groups. The script includes routes that require authentication and specific roles and groups to access.

Web-AuthOauth2

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication using Azure AD and OAuth2.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to use session persistent authentication with Azure AD and OAuth2.

Web-AuthOauth2Form

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication using Azure AD and OAuth2.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to use session persistent authentication with Azure AD and OAuth2, using a form for login without redirection.

Web-AuthOauth2Oidc

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication using Google Cloud and OpenID Connect Discovery.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to use session persistent authentication with Google Cloud and OpenID Connect Discovery.

Web-Cookies

Synopsis

A sample PowerShell script to set up a Pode server with cookie management and signed cookies.

Description

This script sets up a Pode server listening on port 8081. It includes routes for setting, extending, removing, and checking signed cookies. The server uses a global cookie secret for signing the cookies.

Web-Csrf

Synopsis

A sample PowerShell script to set up a Pode server with CSRF protection using either session or cookie-based tokens.

Description

This script sets up a Pode server listening on port 8081. It includes CSRF protection, which can be configured to use either session-based tokens or cookie-based global secrets. The script also sets up a basic route for serving an index page with a CSRF token and a POST route to handle form submissions.

Web-FuncsToRoutes

Synopsis

A sample PowerShell script to set up a Pode server with basic authentication and dynamic route generation.

Description

This script sets up a Pode server listening on port 8081. It includes basic authentication, error logging, and dynamic route generation for specified commands. Each route requires authentication.

Web-Gui

Synopsis

A sample PowerShell script to set up a Pode server with desktop GUI capabilities.

Description

This script sets up a Pode server listening on ports 8081 and 8091. It includes a route to handle GET requests and sets up the server to run as a desktop GUI application using the Pode view engine.

Web-GzipRequest

Synopsis

A sample PowerShell script to set up a Pode server with error logging and a route to handle gzip'd JSON.

Description

This script sets up a Pode server listening on port 8081. It includes error logging and a route to handle POST requests that receive gzip'd JSON data.

Web-Hostname

Synopsis

A sample PowerShell script to set up a Pode server with multiple endpoints.

Description

This script sets up a Pode server listening on multiple endpoints. It demonstrates how to handle GET requests, serve static assets, and download files using Pode's view engine.

Web-HostnameKestrel

Synopsis

A sample PowerShell script to set up a Pode server with Kestrel and various endpoints.

Description

This script sets up a Pode server listening on multiple endpoints using Kestrel. It demonstrates how to handle GET requests, serve static assets, and download files using Pode's view engine.

Web-Imports

Synopsis

A sample PowerShell script to set up a Pode server with various routes, access rules, logging, and request handling.

Description

This script sets up a Pode server listening on multiple endpoints with request redirection. It demonstrates how to handle GET, POST, and other HTTP requests, set up access and limit rules, implement custom logging, and serve web pages using Pode's view engine.

Web-Metrics

Synopsis

A sample PowerShell script to set up a Pode server with a route to check server uptime and restart count.

Description

This script sets up a Pode server listening on port 8081. It includes a route to check the server's uptime and the number of times the server has restarted.

Web-Pages

Synopsis

A sample PowerShell script to set up a Pode server with various routes, access rules, logging, and request handling.

Description

This script sets up a Pode server listening on multiple endpoints with request redirection. It demonstrates how to handle GET, POST, and other HTTP requests, set up access and limit rules, implement custom logging, and serve web pages using Pode's view engine.

Web-PagesDocker

Synopsis

A sample PowerShell script to set up a Pode server with various routes, tasks, and security.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to handle GET and PUT requests, set up security, define tasks, and use Pode's view engine.

Web-PagesHttps

Synopsis

A sample PowerShell script to set up a Pode server with various HTTPS certificate options.

Description

This script sets up a Pode server listening on port 8443 with HTTPS enabled using different certificate options based on the input parameter. It demonstrates how to handle GET requests and serve web pages with Pode's view engine.

Web-PagesKestrel

Synopsis

A sample PowerShell script to set up a Pode server with Kestrel and various routes, access rules, and custom logging.

Description

This script sets up a Pode server listening on multiple endpoints with request redirection using Kestrel. It demonstrates how to handle GET requests, set up access rules, implement custom logging, and handle various routes including redirects and file downloads.

Web-PagesMD

Synopsis

Sample script to set up a Pode server that listens on localhost:8081 and responds to GET requests.

Description

This script initializes a Pode server and sets it to listen on localhost:8081. It uses the Markdown view engine to render responses. The server will respond to GET requests at the root path ('/') by serving an 'index' view.

Web-PagesSimple

Synopsis

A sample PowerShell script to set up a Pode server with multiple endpoints and request handling.

Description

This script sets up a Pode server listening on multiple endpoints with request redirection. It demonstrates how to handle GET requests and redirect requests from one endpoint to another. The script includes examples of using a parameter for the port number and setting up error logging.

Web-PagesUsing

Synopsis

A sample PowerShell script to set up a Pode server with various routes, middleware, and custom functions.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to handle GET requests, use middleware, export and use custom functions, and set up timers. The script includes examples of using $using: scope for variables in script blocks and middleware.

Web-RestApi

Synopsis

A sample PowerShell script to set up a Pode server with HTTP endpoints and request logging.

Description

This script sets up a Pode server listening on port 8081 with various HTTP endpoints for GET and POST requests. It includes request logging with batching and dual mode for IPv4/IPv6.

Web-RestOpenApi

Synopsis

A sample PowerShell script to set up a Pode server with OpenAPI integration and basic authentication.

Description

This script sets up a Pode server listening on multiple endpoints with OpenAPI documentation. It demonstrates how to handle GET, POST, and PUT requests, use OpenAPI for documenting APIs, and implement basic authentication. The script includes routes under the '/api' path and provides various OpenAPI viewers such as Swagger, ReDoc, RapiDoc, StopLight, Explorer, and RapiPdf.

web-RestOpenApiFuncs

Synopsis

A sample PowerShell script to set up a Pode server with OpenAPI integration and various OpenAPI viewers.

Description

This script sets up a Pode server listening on port 8081 with OpenAPI documentation. It demonstrates how to use OpenAPI for documenting APIs and provides various OpenAPI viewers such as Swagger, ReDoc, RapiDoc, StopLight, Explorer, and RapiPdf.

Web-RestOpenApiShared

Synopsis

A sample PowerShell script to set up a Pode server with OpenAPI integration and basic authentication.

Description

This script sets up a Pode server listening on multiple endpoints with OpenAPI documentation. It demonstrates how to handle GET and POST requests, use OpenAPI for documenting APIs, and implement basic authentication. The script includes routes under the '/api' path and provides various OpenAPI viewers such as Swagger, ReDoc, RapiDoc, StopLight, Explorer, and RapiPdf.

Web-RestOpenApiSimple

Synopsis

A sample PowerShell script to set up a Pode server with OpenAPI integration.

Description

This script sets up a Pode server listening on multiple endpoints with OpenAPI documentation. It demonstrates how to handle GET and POST requests, and how to use OpenAPI for documenting APIs. The script includes routes under the '/api' path and provides Swagger and ReDoc viewers.

Web-RouteEndpoints

Synopsis

A sample PowerShell script to set up a Pode server with multiple endpoints and request handling.

Description

This script sets up a Pode server listening on multiple local IP addresses on port 8081. It demonstrates how to handle GET requests for a web page, download a file, handle requests with parameters, and redirect requests from one endpoint to another.

Web-RouteGroup

Synopsis

A sample PowerShell script to set up a Pode server with middleware and basic authentication.

Description

This script sets up a Pode server listening on port 8081. It demonstrates how to use middleware, route groups, and basic authentication. The server includes routes under the '/api' and '/auth' paths, with specific middleware and authentication requirements.

Web-RouteListenNames

Synopsis

A sample PowerShell script to set up a Pode server with multiple endpoints and request handling.

Description

This script sets up a Pode server listening on multiple local IP addresses on port 8081. It demonstrates how to handle GET requests for a web page, including specific handling for different endpoints, downloading a file, and handling requests with parameters.

Web-RouteProtocols

Synopsis

A sample PowerShell script to set up a Pode server with multiple endpoints and request handling.

Description

This script sets up a Pode server listening on port 8081 (HTTP) and 8082 (HTTPS). It demonstrates how to handle GET requests for a web page, download a file, and handle requests with parameters. Additionally, it shows how to redirect all HTTP requests to HTTPS.

Web-Secrets

Synopsis

A sample PowerShell script to set up a Pode server with secret management using Azure Key Vault and a custom vault CLI.

Description

This script sets up a Pode server listening on port 8081 with secret management capabilities. It demonstrates how to register secret vaults with Azure Key Vault and a custom CLI, set and get secrets, and manage secrets using Pode routes. Make sure to install the Microsoft.PowerShell.SecretManagement and Microsoft.PowerShell.SecretStore modules. Also, you need to run "Connect-AzAccount" first for Azure Key Vault.

Web-SecretsLocal

Synopsis

A sample PowerShell script to set up a Pode server with secret management using Microsoft.PowerShell.SecretStore.

Description

This script sets up a Pode server listening on port 8081 with secret management capabilities. It demonstrates how to register a secret vault, set and get secrets, and manage secrets using Pode routes. Make sure to install the Microsoft.PowerShell.SecretManagement and Microsoft.PowerShell.SecretStore modules.

Web-Sessions

Synopsis

A sample PowerShell script to set up a Pode server with session persistent authentication.

Description

This script sets up a Pode server listening on port 8085 with session persistent authentication. It demonstrates a simple server setup with a view counter. Each visit to the root URL ('http://localhost:8085') increments the view counter stored in the session.

Web-Signal

Synopsis

PowerShell script to set up a Pode server with various endpoints and error logging.

Description

This script sets up a Pode server that listens on a specified port and provides both HTTP and WebSocket endpoints. It demonstrates how to set up WebSockets in Pode and logs errors and other request details to the terminal.

Web-SignalConnection

Synopsis

Sample script to set up a Pode server with WebSocket support, listening on localhost.

Description

This script initializes a Pode server that listens on localhost:8081 with WebSocket support. It includes logging to the terminal and several routes and timers for WebSocket connections. The server can connect to a WebSocket from an external script and respond to messages.

Web-SimplePages

Synopsis

PowerShell script to set up a Pode server with various pages and error logging.

Description

This script sets up a Pode server that listens on a specified port and provides several routes to display process and service information, as well as static views.

Web-Sockets

Synopsis

PowerShell script to set up a Pode server with HTTPS and logging.

Description

This script sets up a Pode server that listens on a specified port with HTTPS protocol using a certificate. It includes request logging and provides a sample route to return a JSON response.

Web-Sse

Synopsis

A sample PowerShell script to set up a Pode server with Server-Sent Events (SSE) and logging.

Description

This script sets up a Pode server that listens on port 8081, logs errors to the terminal, and handles Server-Sent Events (SSE) connections. The server sends periodic SSE events and provides routes to interact with SSE connections.

Web-Static

Synopsis

PowerShell script to set up a Pode server with various routes for static assets and view responses.

Description

This script sets up a Pode server that listens on a specified port, logs requests and errors to the terminal, and serves static assets as well as view responses using the Pode view engine.

Web-StaticAuth

Synopsis

PowerShell script to set up a Pode server with basic authentication and various routes for static assets and view responses.

Description

This script sets up a Pode server that listens on a specified port, logs requests and errors to the terminal, and serves static assets as well as view responses using the Pode view engine. It also includes basic authentication for accessing static assets.

Web-TpEPS

Synopsis

PowerShell script to set up a Pode server with EPS view engine.

Description

This script sets up a Pode server that listens on a specified port, logs requests to the terminal, and uses the EPS renderer for serving web pages.

Web-TpPSHTML

Synopsis

PowerShell script to set up a Pode server with PSHTML view engine.

Description

This script sets up a Pode server that listens on a specified port, logs requests to the terminal, and uses the PSHTML renderer for serving web pages.

Web-Upload

Synopsis

PowerShell script to set up a Pode server with file upload routes.

Description

This script sets up a Pode server that listens on a specified port and provides routes for uploading single and multiple files.

Web-UploadKestrel

Synopsis

PowerShell script to set up a Pode server with Kestrel listener and file upload functionality.

Description

This script sets up a Pode server that listens on a specified port using the Kestrel listener type. It serves a web page for file upload and processes file uploads, saving them to the server.

Web-UsePodeAuth

Synopsis

A PowerShell script to set up a Pode server with API key authentication and various route configurations.

Description

Sets up a Pode server that listens on a specified port, enables request and error logging, and configures API key authentication. The script uses the Use-PodeAuth function to load and apply the authentication defined in ./auth/SampleAuth.ps1. The authentication is applied globally to the API routes using Add-PodeAuthMiddleware. The script defines a route to fetch a list of users, which requires authentication using a specified location for the API key (Header, Query, or Cookie).

WebAuth-ApikeyJWT

Synopsis

A PowerShell script to set up a Pode server with JWT authentication and various route configurations.

Description

This script sets up a Pode server that listens on a specified port, enables request and error logging, and configures JWT authentication. It also defines a route to fetch a list of users, requiring authentication.

WebHook

Synopsis

A sample PowerShell script to set up a webhook server using Pode.

Description

This script sets up a webhook server using Pode. It includes endpoints for storing data, subscribing to webhook events, and unsubscribing from webhook events. It also defines an OpenAPI specification for the server and enables Swagger documentation.

WebNunit-RestApi

Synopsis

A sample PowerShell script to set up a Pode server for running NUnit tests.

Description

This script sets up a Pode server listening on port 8081 with a POST endpoint for running NUnit tests. It accepts JSON data specifying the test DLL path and the tests to run, executes the tests using NUnit, and returns the test results as an XML response.

Write-Response

Synopsis

PowerShell script to set up a Pode server with various routes for different response types.

Description

This script sets up a Pode server that listens on a specified port and provides various routes to retrieve process information in different formats (HTML, Text, CSV, JSON, XML, YAML).