Hi there,
I noticed the following in 4.0.6.
This is problematic when running the toolkit without user interaction (e.g. from SCCM tasksequence).
Is there an easy way to set the default mode when not user interactive to Silent instead?
I noticed this has already changed in 4.1.0-rc2, but i have other issues with that release.
Previously, $DeployMode had a default setting in Invoke-AppDeployToolkit.ps1
Around v4.05 or so, the default for the parameter was removed.
So you have 2 ways to set it in Invoke-AppDeployToolkit.ps1:
Add a default value to the $DeployMode parameter:
[Parameter(Mandatory = $false)]
[ValidateSet('Interactive', 'Silent', 'NonInteractive')]
[System.String]$DeployMode = 'Silent',
Or set DeployMode in the $adtSession object near the top of Invoke-AppDeployToolkit.ps1
##================================================
MARK: Variables
##================================================
$adtSession = @{# App variables.
.
.
.
DeployMode = 'Silent'
Thank you for your reply. However this doesn’t solve my problem.
I’m not intending to change the overall deploymode.
I’d like to have it set to ‘Silent‘ ONLY when the toolkit has no active user session, like when running from a SCCM tasksequence. By default, in version 4.0.6, in that situation it will be set to ‘NonInteractive‘ instead of ‘Silent‘. Is there any way to change that default behaviour?
Since there is no logged-in user during a SCCM tasksequence, PSADT v4.x will change $DeployMode to silent, just like in v3.x. (This also prevents all the Show-ADT* functions waiting for a user to click something when there are no users. V3 did that too.)
You could try using theGet-ADTLoggedOnUser function to determine if a user is logged-on or not and then change $adtSession.DeployMode to suit in the Install-ADTDeployment function in Invoke-AppDeployToolkit.ps1.
Thanks for now. I’ll look into this next week. Cheers
1 Like
Despite what the commentary says there, it should go to silent automatically for you. It was a change in 4.0 that it did that.