A collection of PowerShell and web scripts to make IT work easier. Scripts are self-hosted on your own web server so you can run them on any machine with a single one-liner, no files to copy around.
- A Linux web server running Apache or Nginx with PHP 8.0+
- git installed on the server
- Root / sudo access for the initial install
SSH into your server and run:
curl -fsSL https://raw.githubusercontent.com/Leander-Andersen/public-ags-scripts/main/install.sh | sudo bashThis uses all defaults: web root /var/www/html, scripts folder scripts.
If you want to customise the paths, download the script first and pass arguments:
curl -fsSL https://raw.githubusercontent.com/Leander-Andersen/public-ags-scripts/main/install.sh -o install.sh
sudo bash install.sh --webroot /var/www/html --scripts-folder scripts| Parameter | Default | Description |
|---|---|---|
--webroot |
/var/www/html |
Absolute path to your web server's document root. |
--scripts-folder |
scripts |
Name of the folder the scripts will live in under the web root. This becomes the URL path segment, e.g. https://yourserver.com/scripts/. Must be alphanumeric (hyphens and underscores allowed, no spaces). |
--user |
auto-detected | The OS user your web server runs as (www-data, apache, nginx). The installer tries to detect this automatically — only pass it if detection fails. |
--branch |
main |
Which git branch to install from. Use main for stable releases. |
- Clones the repository into
<webroot>/<scripts-folder>/If the destination already exists, it does a hard reset to the latest commit instead. - Copies the file browser (
index.php,viewer.php,globalVariables.php) from the repo to the web root so they serve fromhttps://yourserver.com/. - Sets file ownership on everything it touched to the web server user.
- Prints the URL for the next step.
Open a browser and go to:
http://your-server/<scripts-folder>/setup.php
Enter two values:
- Script domain — the domain or subdomain this server is reachable at (e.g.
scripts.yourdomain.com). Nohttps://, no trailing slash. - Folder name — must match the
--scripts-folderyou used during install (e.g.scripts).
Setup will scan every script in the library, show you a diff of every line that will change, and wait for you to confirm before writing anything. Once applied it:
- Rewrites all
<SCRIPT_DOMAIN>and<SCRIPT_FOLDER>placeholders across every.ps1,.php,.sh, and other text file in the library — including this README, so all URLs below become real copy-paste links - Renames the scripts folder on disk to match what you entered
- Saves your settings to
.setup-config.jsonso updates can re-apply them automatically - Creates
setup.lockto prevent accidental re-runs
After setup your scripts are live:
https://<SCRIPT_DOMAIN>/<SCRIPT_FOLDER>/SetDefaultBrowser/SetDefaultBrowser.ps1
https://<SCRIPT_DOMAIN>/<SCRIPT_FOLDER>/Hextract/Hextract.ps1
https://<SCRIPT_DOMAIN>/<SCRIPT_FOLDER>/PnS/PnS.ps1
Once the library is set up, visit:
https://<SCRIPT_DOMAIN>/<SCRIPT_FOLDER>/update.php
The updater will:
- Fetch the latest commits from GitHub
- Show you a summary of what changed
- Pull the changes with a hard reset to the selected branch
- Automatically re-apply your saved domain and folder settings from
.setup-config.json
You do not need to re-run setup.php or the installer after an update — your configuration is preserved.
The installer places a file browser at the web root (index.php) so visiting https://yourserver.com/ shows a navigable directory listing of all your scripts. Features:
- Click any folder to browse into it
- Click any
.mdfile to render it as formatted markdown (viaviewer.php) - Click any
.ps1or other file to download / view it directly - Dark, light, and OverPinku theme with toggle button (preference saved per-browser)
| Script | What it does |
|---|---|
| SetDefaultBrowser | Sets the default browser on Windows via an interactive menu or silent parameters. Supports Chrome, Firefox, Brave, and removal. |
| Hextract | Generates a hardware hash for Windows Autopilot enrollment. |
| PnS | Retrieves the product name and serial number from a laptop (useful for warranty lookups). |
| Branch | Purpose |
|---|---|
main |
Stable releases — what the installer pulls by default |
experimental |
New features that work but aren't fully hardened yet |
| Feature branches | Work in progress |