diff --git a/README.md b/README.md index 7353c3d..17396e3 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ pwsh ./Scripts/Start-IntuneToolkit.ps1 -TenantId "" * `pwsh` 7+ * Microsoft Graph app registration * App-only auth with client secret or certificate, or browser auth with a public client redirect URI +* `fzf` (optional) — for the best interactive menu experience in `Start-IntuneToolkit.ps1` and `Start-IntuneManagementTui.ps1`. Falls back to numbered menus if not installed. + * macOS: `brew install fzf` + * Linux: `sudo apt install fzf` (or `dnf` / `pacman`) + * Windows: `winget install junegunn.fzf` (or `choco install fzf`) ## Default object types diff --git a/Scripts/Start-IntuneManagementTui.ps1 b/Scripts/Start-IntuneManagementTui.ps1 index 4f6fe24..2af9b87 100644 --- a/Scripts/Start-IntuneManagementTui.ps1 +++ b/Scripts/Start-IntuneManagementTui.ps1 @@ -18,6 +18,26 @@ function Test-FzfAvailable return [bool](Get-Command fzf -ErrorAction SilentlyContinue) } +function Show-FzfHint +{ + if(Test-FzfAvailable) { return } + Write-Host "[fzf not found]" -ForegroundColor Yellow -NoNewline + Write-Host " Install fzf for the best interactive menu experience. Falling back to numbered menus." -ForegroundColor DarkGray + if($IsMacOS) + { + Write-Host " Install: brew install fzf" -ForegroundColor DarkGray + } + elseif($IsLinux) + { + Write-Host " Install: sudo apt install fzf (or dnf/pacman)" -ForegroundColor DarkGray + } + else + { + Write-Host " Install: winget install junegunn.fzf (or choco install fzf)" -ForegroundColor DarkGray + } + Write-Host "" +} + function Show-FzfMenu { param( @@ -126,6 +146,8 @@ if(Test-Path $settingsPath) } #endregion +Show-FzfHint + while($true) { Clear-Host diff --git a/Scripts/Start-IntuneToolkit.ps1 b/Scripts/Start-IntuneToolkit.ps1 index 336151d..30d6a52 100644 --- a/Scripts/Start-IntuneToolkit.ps1 +++ b/Scripts/Start-IntuneToolkit.ps1 @@ -35,6 +35,29 @@ function Test-FzfAvailable return [bool](Get-Command fzf -ErrorAction SilentlyContinue) } +function Show-FzfHint +{ + if(Test-FzfAvailable) { return } + Write-Host "`n[fzf not found]" -ForegroundColor Yellow -NoNewline + Write-Host " Install fzf for the best interactive menu experience.`n" -ForegroundColor DarkGray + if($IsMacOS) + { + Write-Host " macOS: brew install fzf" -ForegroundColor DarkGray + } + elseif($IsLinux) + { + Write-Host " Debian/Ubuntu: sudo apt install fzf" -ForegroundColor DarkGray + Write-Host " Fedora: sudo dnf install fzf" -ForegroundColor DarkGray + Write-Host " Arch: sudo pacman -S fzf" -ForegroundColor DarkGray + } + else + { + Write-Host " Windows: winget install junegunn.fzf" -ForegroundColor DarkGray + Write-Host " choco install fzf" -ForegroundColor DarkGray + } + Write-Host " (Falling back to numbered menus for now.)`n" -ForegroundColor DarkGray +} + function Show-FzfMenu { param( @@ -263,6 +286,8 @@ if(-not $currentTenant -or -not $currentTenant.TenantName) } #endregion +Show-FzfHint + # Build common parameter hashtable $commonParams = @{ TenantId = $TenantId