A lightweight and modern web interface for running PowerShell scripts remotely or locally, built with Next.js 14, TypeScript, and shadcn/ui.
Repository: https://github.com/LoloRigolo/PowerShellWebIHM.git
- Interactive web UI with shadcn components (cards, forms, badges, etc.)
- Execute PowerShell scripts from a secure backend
- Dynamic parameters: text, number, select, checkbox
- Real-time log display
- Environment-based configuration via
.env.local - Modular front-end architecture with
app/router
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 + TypeScript + TailwindCSS + shadcn/ui |
| Backend | Next.js API Routes (Node runtime) |
| Scripting | PowerShell (.ps1) execution via Node child_process |
| Styling | TailwindCSS |
| Icons | lucide-react |
git clone https://github.com/LoloRigolo/PowerShellWebIHM.git
cd PowerShellWebIHMnpm installCreate a .env.local file at the root:
POWERSHELL_EXE_PATH=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
POWERSHELL_SCRIPTS_DIR=C:\<FolderToRepo>\PowerShellWebIHM\scriptspowershell\
npm run devThen open http://localhost:3000
app/
├─ api/
│ └─ run-ps/
│ └─ route.ts → API to run PowerShell scripts
├─ scripts/
│ └─ [slug]/page.tsx → Script execution page
├─ page.tsx → Home page with scripts grid
components/
├─ ScriptsGrid.tsx
├─ ui/… → shadcn/ui components
lib/
└─ scripts.ts → Script definitions & parameters
Write-Host "Hello World from PowerShell!"param(
[Parameter(Mandatory=$true)][string]$path,
[ValidateSet('full','diff','inc')][string]$level = 'full',
[switch]$compress
)
Write-Host "Backup path=$path level=$level compress=$compress"- The API should be protected behind authentication (not yet included)
- Only whitelisted scripts in
lib/scripts.tsshould be exposed - Avoid user-supplied file paths
MIT © Lorenzo Cesana-Rale