diff --git a/Scripts/Start-IntuneToolkit.ps1 b/Scripts/Start-IntuneToolkit.ps1 index 3076df9..821db34 100644 --- a/Scripts/Start-IntuneToolkit.ps1 +++ b/Scripts/Start-IntuneToolkit.ps1 @@ -173,8 +173,15 @@ while($true) 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 - & $scriptPath @commonParams + & $scriptPath @launchParams Write-Host "`nPress any key to return to the menu..." -ForegroundColor DarkGray $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")