Hi, new here and to PSADT in general. I'm trying to deploy Epson Software Updater to Intune/Company Portal. Packaging it without PSADT doesn't work due to a required, interactive EULA.
When running
cd C:\Temp\PSAppDeployToolkit_Template_v4
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Interactive
in CMD, this works perfectly fine. However, as soon as I publish the app in Intune as a .intunewin package and attempt to install in Company Portal, it fails.
My current install command (cmd.exe /c "Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Interactive") is returning Windows error 0x87D30067.
I've tried other install commands, including:
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Interactivepowershell.exe -ExecutionPolicy Bypass -File Invoke-AppDeployToolkit.ps1 -DeploymentType Install -DeployMode Interactive
My Invoke-AppDeployToolkit.ps1 is as follows:
[CmdletBinding()]
param
(
# Default is 'Install'.
[Parameter(Mandatory = $false)]
[ValidateSet('Install', 'Uninstall', 'Repair')]
[System.String]$DeploymentType,
# Default is 'Auto'. Don't hard-code this unless required.
[Parameter(Mandatory = $false)]
[ValidateSet('Auto', 'Interactive', 'NonInteractive', 'Silent')]
[System.String]$DeployMode,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$SuppressRebootPassThru,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$TerminalServerMode,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$DisableLogging
)
##================================================
## MARK: Variables
##================================================
# Zero-Config MSI support is provided when "AppName" is null or empty.
# By setting the "AppName" property, Zero-Config MSI will be disabled.
$adtSession = @{
AppVendor = 'Epson'
AppName = 'Software Updater'
AppVersion = '1.0'
AppArch = ''
AppLang = 'EN'
AppRevision = '01'
AppSuccessExitCodes = @(0)
AppRebootExitCodes = @(1641, 3010)
AppProcessesToClose = @('EPSDNAVI', 'EPSDNMON')
AppScriptVersion = '1.0.0'
AppScriptDate = '2026-04-08'
AppScriptAuthor = 'IT Administrator'
RequireAdmin = $true
InstallName = ''
InstallTitle = ''
DeployAppScriptFriendlyName = $MyInvocation.MyCommand.Name
DeployAppScriptParameters = $PSBoundParameters
DeployAppScriptVersion = '4.1.8'
}
function Install-ADTDeployment
{
[CmdletBinding()]
param
(
)
##================================================
## MARK: Pre-Install
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
##================================================
## MARK: Install
##================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
## <Perform Installation tasks here>
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\CESU5020.exe"
##================================================
## MARK: Post-Install
##================================================
$adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"
}
function Uninstall-ADTDeployment
{
[CmdletBinding()]
param
(
)
##================================================
## MARK: Pre-Uninstall
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
## If there are processes to close, show Welcome Message with a 60 second countdown before automatically closing.
if ($adtSession.AppProcessesToClose.Count -gt 0)
{
Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -CloseProcessesCountdown 60
}
## Show Progress Message (with the default message).
Show-ADTInstallationProgress
## <Perform Pre-Uninstallation tasks here>
##================================================
## MARK: Uninstall
##================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
## Handle Zero-Config MSI uninstallations.
if ($adtSession.UseDefaultMsi)
{
$ExecuteDefaultMSISplat = @{ Action = $adtSession.DeploymentType; FilePath = $adtSession.DefaultMsiFile }
if ($adtSession.DefaultMstFile)
{
$ExecuteDefaultMSISplat.Add('Transforms', $adtSession.DefaultMstFile)
}
Start-ADTMsiProcess @ExecuteDefaultMSISplat
}
## <Perform Uninstallation tasks here>
Start-ADTMsiProcess -Action Uninstall -FilePath "{946E5AD1-584A-4830-BA1B-BEA47E1D549F}"
##================================================
## MARK: Post-Uninstallation
##================================================
$adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"
## <Perform Post-Uninstallation tasks here>
}
function Repair-ADTDeployment
{
[CmdletBinding()]
param
(
)
##================================================
## MARK: Pre-Repair
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
## If there are processes to close, show Welcome Message with a 60 second countdown before automatically closing.
if ($adtSession.AppProcessesToClose.Count -gt 0)
{
Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -CloseProcessesCountdown 60
}
## Show Progress Message (with the default message).
Show-ADTInstallationProgress
## <Perform Pre-Repair tasks here>
##================================================
## MARK: Repair
##================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
## Handle Zero-Config MSI repairs.
if ($adtSession.UseDefaultMsi)
{
$ExecuteDefaultMSISplat = @{ Action = $adtSession.DeploymentType; FilePath = $adtSession.DefaultMsiFile }
if ($adtSession.DefaultMstFile)
{
$ExecuteDefaultMSISplat.Add('Transforms', $adtSession.DefaultMstFile)
}
Start-ADTMsiProcess @ExecuteDefaultMSISplat
}
## <Perform Repair tasks here>
##================================================
## MARK: Post-Repair
##================================================
$adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"
## <Perform Post-Repair tasks here>
}
##================================================
## MARK: Initialization
##================================================
# Set strict error handling across entire operation.
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue
Set-StrictMode -Version 1
# Import the module and instantiate a new session.
try
{
# Import the module locally if available, otherwise try to find it from PSModulePath.
if (Test-Path -LiteralPath "$PSScriptRoot\PSAppDeployToolkit\PSAppDeployToolkit.psd1" -PathType Leaf)
{
Get-ChildItem -LiteralPath "$PSScriptRoot\PSAppDeployToolkit" -Recurse -File | Unblock-File -ErrorAction Ignore
Import-Module -FullyQualifiedName @{ ModuleName = "$PSScriptRoot\PSAppDeployToolkit\PSAppDeployToolkit.psd1"; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.8' } -Force
}
else
{
Import-Module -FullyQualifiedName @{ ModuleName = 'PSAppDeployToolkit'; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.8' } -Force
}
# Open a new deployment session, replacing $adtSession with a DeploymentSession.
$iadtParams = Get-ADTBoundParametersAndDefaultValues -Invocation $MyInvocation
$adtSession = Remove-ADTHashtableNullOrEmptyValues -Hashtable $adtSession
$adtSession = Open-ADTSession @adtSession @iadtParams -PassThru
}
catch
{
$Host.UI.WriteErrorLine((Out-String -InputObject $_ -Width ([System.Int32]::MaxValue)))
exit 60008
}
##================================================
## MARK: Invocation
##================================================
# Commence the actual deployment operation.
try
{
# Import any found extensions before proceeding with the deployment.
Get-ChildItem -LiteralPath $PSScriptRoot -Directory | & {
process
{
if ($_.Name -match 'PSAppDeployToolkit\..+$')
{
Get-ChildItem -LiteralPath $_.FullName -Recurse -File | Unblock-File -ErrorAction Ignore
Import-Module -Name $_.FullName -Force
}
}
}
# Invoke the deployment and close out the session.
& "$($adtSession.DeploymentType)-ADTDeployment"
Close-ADTSession
}
catch
{
# An unhandled error has been caught.
$mainErrorMessage = "An unhandled error within [$($MyInvocation.MyCommand.Name)] has occurred.`n$(Resolve-ADTErrorRecord -ErrorRecord $_)"
Write-ADTLogEntry -Message $mainErrorMessage -Severity 3
## Error details hidden from the user by default. Show a simple dialog with full stack trace:
# Show-ADTDialogBox -Text $mainErrorMessage -Icon Stop -NoWait
## Or, a themed dialog with basic error message:
# Show-ADTInstallationPrompt -Message "$($adtSession.DeploymentType) failed at line $($_.InvocationInfo.ScriptLineNumber), char $($_.InvocationInfo.OffsetInLine):`n$($_.InvocationInfo.Line.Trim())`n`nMessage:`n$($_.Exception.Message)" -ButtonRightText OK -Icon Error -NoWait
Close-ADTSession -ExitCode 60001
}
I did delete the Welcome message snippet from Install-ADTDeployment. I had read from a Reddit post that seemed to imply this was the cause of my issue, but I'm not certain. It didn't seem have an effect when testing in CMD.
Any advice would be greatly appreciated. Please let me know if you need more information.