Start-HttpServer

1.0.1

Starts a lightweight static file server using the built-in .NET HttpListener class,
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.

The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
Starts a lightweight static file server using the built-in .NET HttpListener class,
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.

The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
GET and HEAD requests, common content types, directory redirects, and conditional
caching with Last-Modified and If-Modified-Since. Missing paths and requests that
resolve outside SiteRoot return 404.

By default, the server listens on all network interfaces at port 8000, similar to
Python's http.server. Use LocalOnly to restrict access to this computer at
http://localhost:8000/. LAN access requires an elevated PowerShell session and an
enabled inbound Windows Firewall rule for the selected TCP port.

This script is intended for local development, testing, demonstrations, and quick
file sharing. It is not intended to replace a production web server.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Start-HttpServer

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

Author(s)

  • MrDRamos

Tags

http server web static files python http.server

Functions

Get-LocalLanAddress Test-IsAdministrator Test-LanFirewallPortOpen Get-DirectoryListingHtml Get-ContentType

Dependencies

This script has no dependencies.

Release Notes

Initial release.

FileList

Version History

Version Downloads Last updated
1.0.1 (current version) 6 9/12/2026
1.0.0 5 9/12/2026