Changes in v4
Overview
- Modern Fluent user interface
- Digitally signed PowerShell module
- All C# code is now compiled
- Codebase completely refactored and optimized
- Removed all VBScript code
- Strongly typed and defined object types (no more PSCustomObjects, etc.)
- Defensive coding to ensure security and reliability
- Now provides PowerShell 7 and ARM support
- Extensions supported as supplemental modules
- Custom action support for extensions on deployment start and finish
- Support for overriding config via the registry
- Backwards-compatibility with v3 deployment scripts
Key Filename Changes
Further changes to the deployment layout are detailed in the Deployment Structure page.
Old Name | New Name | More Information |
---|---|---|
Deploy-Application.ps1 | Invoke-AppDeployToolkit.ps1 | Invoke-AppDeployToolkit |
Deploy-Application.exe | Invoke-AppDeployToolkit.exe | Invoke-AppDeployToolkit |
AppDeployToolkitConfig.xml | Config\Config.psd1 | Configuration Settings |
Was part of Config file | Strings\Strings.psd1 | Language Strings |
New Configuration Format
- .psd1 is the native PowerShell config file format. See Customizing Deployments for more information.
Key Function Name Changes
For a detailed mapping of all v3 to v4 functions, see the Function Mapping page.
- Certain function names have been changed to avoid collisions with other scripts or modules.
Old Name | New Name / Details |
---|---|
Copy-File | Copy-ADTFile |
Execute-Process | Start-ADTProcess |
Write-Log | Write-ADTLogEntry |
Variables
- Standard toolkit environment variables, such as
$envProgramFiles
, become available once an ADTSession is opened or after theExport-ADTEnvironmentTableToSessionState
command is executed. - Variables specific to a particular deployment (for example,
$appName
) are found within the ADTSession object (for example,$adtSession.AppName
).
Booleans Replaced with Switches
v3 used many Boolean parameters, some defaulting to true and others to false. It was not always clear what the default behavior was without referencing documentation.
- Instead of
TopMost $true
or-TopMost $false
, there is now a single optional switch,-NotTopMost
, which clarifies that the default behavior is TopMost.
Standardized Filtering
The Remove-MsiApplications
command in v3 used -FilterApplication
and -ExcludeFromUninstall
parameters with a complex syntax. In the new function, Uninstall-ADTApplication, these have been replaced with a single -FilterScript
, similar to PowerShell's Where-Object
:
-FilterScript { $_.Publisher -eq 'Oracle Corporation' -and $_.DisplayVersion -notmatch 'Java 8 Update 45' }
ScriptBlock Variables
Previously, Invoke-HKCURegistrySettingsForAllUsers
in v3 required a $UserProfile
variable. In v4, Invoke-ADTAllUsersRegistryAction pipes user profile objects to the provided scriptblock, so you can use $_
:
Invoke-ADTAllUsersRegistryAction -ScriptBlock {
Set-ADTRegistryKey -Key 'HKCU\Software\Microsoft\Office\14.0\Common' -Name 'qmenable' -Value 0 -Type DWord -SID $_.SID
}
Standardized Array Inputs
Functions that accept multiple values now take arrays rather than comma-delimited strings. For example, instead of:
Show-InstallationWelcome -CloseApps 'iexplore,winword,excel'
you can specify:
Show-ADTInstallationWelcome -CloseProcesses iexplore, winword, excel
Error Handling
Many commands in v3 used a -ContinueOnError
parameter. In v4, you use the standard PowerShell -ErrorAction
parameter:
- Instead of
-ContinueOnError $true
or$false
, use-ErrorAction Stop
or-ErrorAction SilentlyContinue
.
Uninstallation of EXE Apps
Uninstall-ADTApplication can now uninstall EXE apps in addition to MSI. Specify the -ApplicationType
parameter to focus on one type or the other. The -ArgumentList
parameter replaces any detected arguments in the registry, and -AdditionalArgumentList
appends to them.
User Profile Paths
Get-ADTUserProfiles now has a -LoadProfilePaths
switch to discover common folders within user profiles, such as Documents and Desktop. You can use Copy-ADTFileToUserProfiles to copy files directly to these locations.
WIM Support
There is now support for compressing file content into a WIM archive and mounting it during installation. You can manage this manually using Mount-ADTWimFile and Dismount-ADTWimFile, or you can use the -ForceWimDetection
switch with Open-ADTSession to auto-mount and dismount any WIM files found.
If you leave the AppName blank, Zero Config will start automatically, mount any WIM file found, and install the MSI located inside.