fix(launcher): strip unsupported auth params when calling Initialize-IntuneAuth

This commit is contained in:
2026-04-14 18:27:40 +02:00
parent 68a5af1af3
commit 773ab12901

View File

@@ -173,8 +173,15 @@ while($true)
Write-Host "`nLaunching $script ...`n" -ForegroundColor Green Write-Host "`nLaunching $script ...`n" -ForegroundColor Green
# Clone params and sanitize for scripts that don't accept the full auth set
$launchParams = $commonParams.Clone()
if($script -eq "Scripts/Initialize-IntuneAuth.ps1")
{
@("AppId","Secret","Certificate","AuthMode","RedirectUri","Interactive","Mode","WhatIf") | ForEach-Object { $launchParams.Remove($_) }
}
# Execute in same process so TUI flows naturally # Execute in same process so TUI flows naturally
& $scriptPath @commonParams & $scriptPath @launchParams
Write-Host "`nPress any key to return to the menu..." -ForegroundColor DarkGray Write-Host "`nPress any key to return to the menu..." -ForegroundColor DarkGray
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")