There was a requirement for an application installation that to display a warning to start saving and closing apps one hour before. So was thinking of using this
I think we will need a little bit more information to assist you.
What version of PSADT are you using? Version 4.1.7 is the latest version currently
How are you installing the App from SCCM (In the Users context or as SYSTEM)?
I'm suspecting you may be using an earlier version of PSADT 4.x which at that time required the use of ServiceUI.exe to show any SYSTEM context messaging to the User (in the Users Context).
N.B. ServiceUI is no longer needed (or recommended) in the latest versions of PSADT.
As a minor correction, ServiceUI hasn't been required since 4.1.0. All 4.1.x releases thereafter are bug fixes without change in functionality, unless that functionality was impaired.
Set correctly in SCCM
so that the user can decide for themselves
I have solved the time counter differently, with a dialogue box that counts down in advance, see below, but then I remove the move option "DeferTimes=0"
SCCM: User Experience/Allow user to view ...
Script: NoProcessDetection = $true
$adtSession = @{
##===============================================
# App variables.
##===============================================
NoProcessDetection = $true # With dialogues $True / without dialogues $false
##================================================
## MARK: Pre-Install
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
## Show Welcome Message, close processes if specified, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt.
#region siehe Hilfe
$saiwParams = @{
AllowDefer = $true
DeferTimes = 3
CheckDiskSpace = $true
PersistPrompt = $true
}
Show-ADTInstallationWelcome @saiwParams
#### Counter
if ($MyLanguage -like "de-DE" ) {$MyMessage="10 min wait"}
$MyUser=(Get-ADTLoggedOnUser).Username
Write-ADTLogEntry -Message "angemelderter User: $MyUser"
Write-ADTLogEntry -Message "Sprache: $MyLanguage"
Write-ADTLogEntry -Message "$MyMessage"
if ($MyUser) {if (!$adtSession.UseDefaultMsi) {Show-ADTInstallationPrompt -Title 'Installation - xxxx Helpdesk' -Message $MyMessage -ButtonRightText 'OK' -Icon Information -Timeout 600} }