with regards to providing logs, it was mentioned in this post why the logs will not be captured and i have tested locally as I mentioned earlier.
I've managed to get it working by moving silent restart in the post-uninstallation tasks:
## <Perform Post-Uninstallation tasks here>
if ($uninstallResult.ExitCode -eq 3010) {
$script:namUninstalled = $true
if ($runAsActiveUser) {
try {
Start-ADTProcessAsUser @processParams # remind users to reconnect to wifi
}
catch {
Write-ADTLogEntry -Message "Toast notification failed to execute"
continue
}
}
else {
Show-ADTInstallationRestartPrompt -SilentRestart
}
}
I then removed the else statement at the end of the try catch block to only show the restart prompt if user is logged in.
finally
{
if (!(Get-Variable -Name mainErrorMessage -ErrorAction Ignore))
{
Initialize-ADTModule -ScriptDirectory $PSScriptRoot
if ($runAsActiveUser -and $script:namUninstalled)
{
Start-Sleep -Seconds 30
Show-ADTInstallationRestartPrompt -CountdownSeconds 3600 -Title "Please restart your computer" -Subtitle "Cisco NAM has been uninstalled. Restart your computer to complete the process." -WindowLocation TopCenter
Start-Sleep -Seconds 3630
}
}
}
I'm probably repeating myself with the code and would be good to get some guidance.