Migrate PSADT 3.x apps to PSADT 4.x

Late last year a new release of the Powershell AppDeploy Toolkit (PSADT) surfaced. The application deployment framework is at the time of writing on version 4.0.6 and compared to version 3.x, it has received a major overhaul on almost all areas. In a coming article I will cover some of the changes in the new PSADT 4.x. However, in this article I will show how to convert an existing PSADT 3.x based application to PSADT 4.x. using the PSAppDeployToolkit and PSAppDeployToolkit.Tools Powershell modules.

If you are not familiar with the Powershell AppDeploy Toolkit framework, I have written a 3-part article on how get started with streamlining application management with PSADT and Microsoft Intune. Get started with part 1 of the articles here.

PSADTv3 migration

Prerequisites

As mentioned, the migration script makes use of the PSAppDeployToolkit and PSAppDeployToolkit.Tools modules, so they have to be installed before executing the migration script.

Currently, the PSAppDeployToolkit.Tools module is in a Pre-Release stage, which means the -AllowPrerelease parameter needs to be appended the Import-Module command:

Install-Module PSAppDeployToolkit.Tools -Scope CurrentUser -AllowPreRelease

In this case I am also using the -CurrentUser parameter, which will import the module in user context which does not require local administrative privileges.

Executing above mentioned command might lead to this magnificent error message:

This message means that the current version of the PowershellGet module is not version 2.2.5 or later.
This means, before executing the migration script you will have to update the PowershellGet module, otherwise the script will fail!

To update the PowershellGet module and avoid uncomfortable questions like this:

…a series of commands can be used:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # Trust the Microsoft PSGallery
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser # Install the latest NuGet package provider
Install-Module PowerShellGet -Force -Scope CurrentUser -AllowClobber # Install the latest PowershellGet module

The first line adds the PSGallery as a trusted source, the second line installs the NuGet package provider and the third installs or updates the PowershellGet module.

Hopefully everything will go through successfully. Afterwards the current Powershell/Terminal console must be closed to reinitialize the installed/updated PowershellGet command.

The script

The script file contains information and examples on how to execute the script. However, I will just go through the 4 supported and needed parameters, to give a bit of context and share my thoughts about how the script can/should be used.

Script parameters

The SourceAppFolder and NewAppFolder parameters are mandatory, whereas the NewAppMediaFoldername and NewAppLogPath parameters are not.

SourceAppFolder

The source folder where one or more PSADTv3 based applications are located. The script will do a recursive list of folders and store the folder name as a variable. This folder name will be the same for the new converted PSADTv4 application.

NewAppFolder

The destination folder where the new converted PSADTv4 app should be created.

NewAppMediaFolderName

This will create a subfolder in the NewAppFolder, which will contain both the application source files and the PSADTv4 framework script

NewAppLogPath

This will change the default log path location.

A script syntax could look like this:

.\Migrate-PSADTv3App -SourceAppFolder "C:\temp\PSADTv3" -NewAppFolder "C:\temp\PSADTv4" -NewAppMediaFolderName "Media" -NewAppLogPath "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs"

This is one of the examples mentioned in the script file.
This will migrate all PSADTv3 based applications in the C:\temp\PSADTv3 folder to the C:\temp\PSADTv4\Media folder and change the default log file location to C:\ProgramData\Microsoft\IntuneManagementExtension\Logs.

If you don’t want or need the “Media”, you can omit the -NewAppMediaFolder parameter:

.\Migrate-PSADTv3App -SourceAppFolder "C:\temp\PSADTv3" -NewAppFolder "C:\temp\PSADTv4" -NewAppLogPath "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs"

This will migrate all PSADTv3 based applications in the C:\temp\PSADTv3 folder to the C:\temp\PSADTv4 folder and change the default log file location to C:\ProgramData\Microsoft\IntuneManagementExtension\Logs.

Seeing is believing

I have created a small screen recording showing the migration script in action.

Here I am demonstrating the PSADTv3 migration of Citrix Workspace App and Notepad++ to PSADTv4. The script is migrating the source files and converting both the install and uninstall syntaxes to the new cmdlets in PSADTv4. The log path for both MSI file deployment and the toolkit itself is also configured.

You can get the script from my Github repo – Microsoft-Intune/Scripts/Migrate PSADTv3 to PSADTv4 at master · kaspersmjohansen/Microsoft-Intune

Test it out and let me know if you run into any issues or if you have feature requests.

This concludes the article. Feel free to reach out to me on X or on LinkedIn if you have any comments or questions.