feat: add intune shell wrapper

./intune starts the launcher without typing pwsh. ./intune <Script> [args]
runs Scripts/<Script>.ps1 or .py. Resolves symlinks so it can be linked
onto PATH; reports a missing pwsh/python3 and lists scripts for an unknown
name.
This commit is contained in:
2026-11-24 12:27:15 +01:00
parent 1733c22c86
commit b8e333f92d
3 changed files with 43 additions and 0 deletions
+1
View File
@@ -122,6 +122,7 @@ The launcher caches tenant display names in `Settings.json` so the TUI can show
| Script | Purpose |
|---|---|
| `intune` | Bash wrapper (macOS/Linux): launcher by default, or `intune <Script> [args]` to run any `Scripts/*.ps1`/`*.py` without typing `pwsh`. Symlink onto PATH. |
| `Start-IntuneToolkit.ps1` | Unified reverse-numbered `fzf`/numbered menu; remembers tenants; launches all other tools. |
| `Scripts/Start-HeadlessIntune.ps1` | Single-action wrapper (`Export`, `Import`, `DeployCISBaseline`, `GenerateReports`) with optional interactive TUI. |
| `Scripts/Export-SettingsReport.py` | Generate a flat CSV of policy settings/values. Includes a `Platform` column and resolves Settings Catalog names from `configurationSettings.json` (auto-exported with Settings Catalog). |
+6
View File
@@ -1,5 +1,11 @@
# macOS Intune Toolkit Changelog
## 2026-11-24 — v4.5.2 — Shell wrapper
### Added
- **`intune`** (repo root, bash)
- Start the toolkit without typing `pwsh`: `./intune` opens the launcher, `./intune -TenantId <id>` passes parameters to it, and `./intune <Script> [args]` runs any `Scripts/<Script>.ps1` or `.py` (e.g. `intune Export-Policies -TenantId <id> -ExportPath ~/out`, `intune Compare-Tenants --root-a ... --root-b ...`). Resolves symlinks, so `ln -s "$PWD/intune" ~/.local/bin/intune` works from anywhere. Prints a clear message when `pwsh` or `python3` is missing and lists available scripts for an unknown name.
## 2026-11-24 — v4.5.1 — Full tenant export menu entry
### Added
Executable
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Wrapper so the toolkit can be started from a shell without typing pwsh first.
# intune interactive launcher (Start-IntuneToolkit.ps1)
# intune -TenantId <id> ... launcher with parameters
# intune <Script> [args] run Scripts/<Script>.ps1 or .py, e.g.
# intune Export-Policies -TenantId <id> -ExportPath ~/out
# intune Compare-Tenants --root-a A --root-b B
# Symlink it onto your PATH: ln -s "$PWD/intune" ~/.local/bin/intune
set -euo pipefail
src="${BASH_SOURCE[0]}"
while [ -L "$src" ]; do
dir="$(cd -P "$(dirname "$src")" && pwd)"
src="$(readlink "$src")"
[[ "$src" != /* ]] && src="$dir/$src"
done
root="$(cd -P "$(dirname "$src")" && pwd)"
need() { command -v "$1" >/dev/null 2>&1 || { echo "intune: '$1' not found. $2" >&2; exit 127; }; }
if [ $# -gt 0 ] && [[ "$1" != -* ]]; then
name="${1%.ps1}"; name="${name%.py}"; shift
if [ -f "$root/Scripts/$name.py" ]; then
need python3 "Install Python 3."
exec python3 "$root/Scripts/$name.py" "$@"
elif [ -f "$root/Scripts/$name.ps1" ]; then
need pwsh "Install PowerShell 7: brew install powershell"
exec pwsh -NoProfile -File "$root/Scripts/$name.ps1" "$@"
fi
echo "intune: no script 'Scripts/$name.ps1' or '.py'. Available:" >&2
ls "$root/Scripts" | grep -E '\.(ps1|py)$' | grep -v '^_' | sed -E 's/\.(ps1|py)$//' | sort -u | sed 's/^/ /' >&2
exit 2
fi
need pwsh "Install PowerShell 7: brew install powershell"
exec pwsh -NoProfile -File "$root/Start-IntuneToolkit.ps1" "$@"