feat(ui): detect missing fzf and show installation hints
This commit is contained in:
@@ -38,6 +38,10 @@ pwsh ./Scripts/Start-IntuneToolkit.ps1 -TenantId "<tenant-id>"
|
|||||||
* `pwsh` 7+
|
* `pwsh` 7+
|
||||||
* Microsoft Graph app registration
|
* Microsoft Graph app registration
|
||||||
* App-only auth with client secret or certificate, or browser auth with a public client redirect URI
|
* 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
|
## Default object types
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,26 @@ function Test-FzfAvailable
|
|||||||
return [bool](Get-Command fzf -ErrorAction SilentlyContinue)
|
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
|
function Show-FzfMenu
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
@@ -126,6 +146,8 @@ if(Test-Path $settingsPath)
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Show-FzfHint
|
||||||
|
|
||||||
while($true)
|
while($true)
|
||||||
{
|
{
|
||||||
Clear-Host
|
Clear-Host
|
||||||
|
|||||||
@@ -35,6 +35,29 @@ function Test-FzfAvailable
|
|||||||
return [bool](Get-Command fzf -ErrorAction SilentlyContinue)
|
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
|
function Show-FzfMenu
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
@@ -263,6 +286,8 @@ if(-not $currentTenant -or -not $currentTenant.TenantName)
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Show-FzfHint
|
||||||
|
|
||||||
# Build common parameter hashtable
|
# Build common parameter hashtable
|
||||||
$commonParams = @{
|
$commonParams = @{
|
||||||
TenantId = $TenantId
|
TenantId = $TenantId
|
||||||
|
|||||||
Reference in New Issue
Block a user