- Rust 83.4%
- PowerShell 6.9%
- JavaScript 6.1%
- CSS 2.1%
- Shell 1.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .idea | ||
| crates | ||
| docs | ||
| examples | ||
| module/PwshManager | ||
| tests | ||
| .betterleaks.toml | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Pwsh-manager
A Rust re-implementation of the core of PowerShell Universal: keep PowerShell scripts in a Git-backed repository, expose them as REST APIs, run them as automated jobs on schedules, render them as interactive apps, and protect all of it with users, roles, API tokens and a management API plus web console.
The design, the per-scope crate map and the frozen cross-crate interfaces live in docs/ARCHITECTURE.md; how to run the service and use every screen of the console is in docs/MANUAL.md. Feature and scope details go in those documents, not here.
Layout
| Crate | Responsibility |
|---|---|
pwshm-core |
Domain model, configuration, errors, permissions |
pwshm-store |
SQLite persistence (WAL, serialised writers) |
pwshm-auth |
Users, roles, tokens, JWT sessions, RBAC |
pwshm-pwsh |
PowerShell process bridge (context/result/response files) |
pwshm-scripts |
Script repository and Git integration |
pwshm-endpoints |
Custom REST endpoints and OpenAPI |
pwshm-jobs |
Automation job engine (queue, live logs, cancel) |
pwshm-schedules |
Cron/interval scheduling |
pwshm-apps |
Dashboard/app runtime and renderer |
pwshm-api |
Management API, public routes, embedded web console |
pwshm-server |
pwshm-server binary, CLI and wiring |
module/PwshManager |
PowerShell module for code-first configuration |
Quick start
cargo run -p pwshm-server -- init
PSM_ADMIN_PASSWORD=changeme cargo run -p pwshm-server -- serve
Then open http://localhost:5000/ for the console and
http://localhost:5000/api/v1/status for the API. pwshm-server --help lists
the rest of the CLI (config check, run, user, token, version).
Scripts, endpoints, apps, schedules and variables can also be declared in
PowerShell under repository/.pwshm/*.ps1 using the bundled module; see
examples/demo for a working configuration.
Tests
. /workspace/.pwshm-env.sh # zig toolchain, cargo home, portable pwsh
cargo test --workspace # unit + integration tests for every crate
bash tests/e2e.sh # boots the server and drives the real HTTP API
tests/e2e.sh covers login, RBAC, script CRUD on disk, job run/wait/output/
cancel, custom endpoints, openapi.json, app shell and component render,
schedule run-now, secret-variable masking, API tokens, static files and the
console. Last run: 57 passed, 0 failed.
Licence
MIT