fix(tui): stop re-asking action when launcher already picked Export/Import

Same missing-passthrough bug as the earlier tenant re-prompt fix, this time
for -Action: Start-IntuneManagementTui.ps1 always showed the
Export/Import/DeployCISBaseline/GenerateReports picker even when the
launcher's menu items 1/2 had already decided it. Launcher now passes
-Action through, TUI skips the prompt when supplied.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 11:37:35 +02:00
parent ae71f8458d
commit 30170a1909
6 changed files with 25 additions and 8 deletions
+8
View File
@@ -1,5 +1,13 @@
# macOS Intune Toolkit Changelog # macOS Intune Toolkit Changelog
## 2026-08-07 — v4.3.1 — Fix redundant action prompt
### Fixed
- **`Scripts/Private/Start-IntuneManagementTui.ps1`**
- Choosing **1. Export policies** or **2. Import policies** in the launcher still re-asked "Select action" (Export/Import/DeployCISBaseline/GenerateReports) — the same missing-passthrough issue as the tenant re-prompt fix below, just for `-Action`. Now accepts `-Action` and skips the prompt when it's already supplied.
- **`Start-IntuneToolkit.ps1`** / **`Scripts/Start-HeadlessIntune.ps1`**
- Menu items 1/2 now pass `-Action Export` / `-Action Import` through to the headless script and on to the TUI.
## 2026-08-07 — v4.3.0 — Bulk delete tool and TUI fixes ## 2026-08-07 — v4.3.0 — Bulk delete tool and TUI fixes
### Added ### Added
+1 -1
View File
@@ -2,7 +2,7 @@
Cross-platform, headless Intune policy export/import with PowerShell. Cross-platform, headless Intune policy export/import with PowerShell.
**Current version:** `4.3.0` — see [`CHANGELOG_macOS_IntuneToolkit.md`](CHANGELOG_macOS_IntuneToolkit.md) for recent changes. **Current version:** `4.3.1` — see [`CHANGELOG_macOS_IntuneToolkit.md`](CHANGELOG_macOS_IntuneToolkit.md) for recent changes.
This repository is now CLI-first. The old WPF application surface has been removed from the repo. The supported workflow is: This repository is now CLI-first. The old WPF application surface has been removed from the repo. The supported workflow is:
+11 -3
View File
@@ -9,7 +9,8 @@
#> #>
[CmdletBinding()] [CmdletBinding()]
param( param(
[string]$TenantId [string]$TenantId,
[string]$Action
) )
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@@ -159,8 +160,15 @@ while($true)
Write-Host " Press Esc to go back, Space to select" -ForegroundColor DarkGray Write-Host " Press Esc to go back, Space to select" -ForegroundColor DarkGray
# 1. Action # 1. Action
$action = Select-MenuItem -Items @("Export","Import","DeployCISBaseline","GenerateReports") -Header "Select action" if($Action)
if(-not $action) { continue } {
$action = $Action
}
else
{
$action = Select-MenuItem -Items @("Export","Import","DeployCISBaseline","GenerateReports") -Header "Select action"
if(-not $action) { continue }
}
# CIS M365 Baseline deployment flow # CIS M365 Baseline deployment flow
if($action -eq "DeployCISBaseline") if($action -eq "DeployCISBaseline")
+1 -1
View File
@@ -84,7 +84,7 @@ if($Interactive)
$tuiScript = Join-Path (Split-Path -Parent $PSScriptRoot) "Scripts/Private/Start-IntuneManagementTui.ps1" $tuiScript = Join-Path (Split-Path -Parent $PSScriptRoot) "Scripts/Private/Start-IntuneManagementTui.ps1"
if(Test-Path $tuiScript) if(Test-Path $tuiScript)
{ {
$tuiResult = & $tuiScript -TenantId $TenantId $tuiResult = & $tuiScript -TenantId $TenantId -Action $Action
if(-not $tuiResult) { Write-Host "No selection made. Exiting." -ForegroundColor Yellow; exit 0 } if(-not $tuiResult) { Write-Host "No selection made. Exiting." -ForegroundColor Yellow; exit 0 }
foreach($prop in $tuiResult.PSObject.Properties) foreach($prop in $tuiResult.PSObject.Properties)
{ {
+3 -2
View File
@@ -385,13 +385,14 @@ while($true)
# Clear any mode-specific params from previous loop iteration # Clear any mode-specific params from previous loop iteration
$commonParams.Remove("Interactive") $commonParams.Remove("Interactive")
$commonParams.Remove("Action")
$commonParams.Remove("Mode") $commonParams.Remove("Mode")
$commonParams.Remove("WhatIf") $commonParams.Remove("WhatIf")
switch($choiceNumber) switch($choiceNumber)
{ {
1 { $commonParams.Interactive = $true } 1 { $commonParams.Interactive = $true; $commonParams.Action = "Export" }
2 { $commonParams.Interactive = $true } 2 { $commonParams.Interactive = $true; $commonParams.Action = "Import" }
5 { $commonParams.Mode = "Backup" } 5 { $commonParams.Mode = "Backup" }
6 { $commonParams.Mode = "Restore" } 6 { $commonParams.Mode = "Restore" }
11 { $commonParams.WhatIf = $true } 11 { $commonParams.WhatIf = $true }
+1 -1
View File
@@ -1 +1 @@
4.3.0 4.3.1