Changes in v4
Overview
- Modern Fluent user interface
- Digitally signed PowerShell module
- All C# code is now compiled
- Codebase completely refactored and optimized
- Complete removal of VBScript code
- Strongly typed and defined object types, no more PSCustomObjects, etc
- Defensively coded 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/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 PowerShell's native config file format. See the Customizing Deployments page for further info.
Key Function Name Changes
For a detailed mapping of all v3 to v4 functions, check out the Function Mapping page.
- The following table highlights the key function name changes where functions hve been renamed to avoid collisions with other scripts / modules.
Old Name | New Name / Details |
---|---|
Copy-File | Copy-ADTFile |
Execute-Process | Start-ADTProcess |
Write-Log | Write-ADTLogEntry |
Variables
-
The standard toolkit environment variables (e.g.
$envProgramFiles
) will be available once an ADTSession has been started, or theExport-ADTEnvironmentTableToSessionState
command has been run. -
Variables specific to a particular deployment (e.g.
$appName
) can now be found within the ADTSession object (e.g.$adtSession.AppName
).
Booleans Replaced with Switches
v3 had many Boolean parameters, some of which default to true, and others to false. It was often difficult to know what the default was for each command without looking up the help or code.
- Now instead of:
TopMost $true
or-TopMost $false
- We have a single optional switch
-NotTopMost
This way, the name of the parameter naturally implies what the default behavior is.
Standardized Filtering
The Remove-MsiApplications
command in v3 had -FilterApplication
and -ExcludeFromUninstall
parameters that use a complex syntax:
FilterApplication @(, @('Publisher', 'Oracle Corporation', 'Exact')) -ExcludeFromUninstall @(, @('DisplayName', 'Java 8 Update 45', 'Contains'))
In the new function Uninstall-ADTApplication, these have now been combined into a single FilterScript that should be familiar to anyone that has used PowerShell's Where-Object
command:
-FilterScript {$_.Publisher -eq 'Oracle Corporation' -and $_.DisplayVersion -notmatch 'Java 8 Update 45'}
ScriptBlock Variables
Invoke-HKCURegistrySettingsForAllUsers
in v3 required the use of a $UserProfile variable:
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings {
Set-RegistryKey -Key 'HKCU\Software\Microsoft\Office\14.0\Common' -Name 'qmenable' -Value 0 -Type DWord -SID $UserProfile.SID
}
In v4, the UserProfile objects are piped to the provided scriptblock, so $_
should be used to represent these objects:
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 accept arrays rather than a single string delimited by commas. For example instead of:
Show-InstallationWelcome -CloseApps 'iexplore,winword,excel'
The process list is now defined like so:
Show-ADTInstallationWelcome -CloseProcesses iexplore, winword, excel
Instead of:
Execute-Process -Path 'setup.exe' -Parameters '/S' -IgnoreExitCodes '1,2'
The exit codes are now defined like so:
Start-ADTProcess -FilePath 'setup.exe' -ArgumentList '/S' -IgnoreExitCodes 1,2
Error Handling
Many commands in v3 used a -ContinueOnError
parameter. In v4, you just use the standard PowerShell -ErrorAction
parameter:
- Instead of:
ContinueOnError $false
or-ContinueOnError $true
- You use:
-ErrorAction Stop
or-ErrorAction SilentlyContinue
Uninstallation of EXE apps
-
Uninstall-ADTApplication
can now support uninstallation of EXE apps in addition to MSI. -
Use the
-ApplicationType
parameter to restrict to one application type or the other. -
-ArgumentList
will replace the detected arguments found in theQuietUninstallString
/UninstallString
in the registry,-AdditionalArgumentList
will append to them.
User Profile Paths
-
Get-ADTUserProfiles
now supports a-LoadProfilePaths
switch to find various common folders for each user profile, such as Documents and Desktop. -
This can be used by
Copy-ADTFileToUserProfiles
to copy files directly to these locations.
WIM Support
-
There is now support for compressing your file content to a WIM archive and mounting it during installation. This can be managed manually via
Mount-ADTWimFile
andDismount-ADTWimFile
. -
Alternatively you can use the
-ForceWimDetection
switch with theOpen-ADTSession
command to auto-mount and dismount any WIM files found.
If you leave the AppName blank, Zero Config will kick in, auto-mount any WIM file found and install the MSI found within.