# PSADT v4 Insider Preview Readme

## Requirements

- Windows 10 1607 / Windows Server 2016 and above
- Windows PowerShell 5.1
- .NET Framework v4.6.2 or higher
- PowerShell 7.4 + is also supported, in conjunction with .NET Windows Desktop Runtime 8.0.

## This archive's contents

Apart from this ReadMe file, there are a few subfolders in this archive.

- **PSADT_v4_InsiderPreview_Module** - this contains the PSAppDeployToolkit module

- **PSADT_v4_InsiderPreview_****Template_v3** - this contains a template ready for you to use an existing v3 Deploy-Application.ps1 script in compatibility mode.

- **PSADT_v4_InsiderPreview_****Template_v4** - this contains a template ready for you to start creating your own custom deployment by modifying the provided Invoke-AppDeployToolkit.ps1

- **Examples** folder - this shows example deployments for WinSCP and VLC, in both v3 and v4 deployment script formats. Note that the source executables have been excluded.

  

## Manual Installation

Installing the module is optional. PowerShell looks in several locations for installed modules - you can check the environment variable PSModulePath to list them:

```Powershell
$env:PSModulePath
```

You can either add a custom location to this variable, or place a copy of the module in the main locations - e.g. for Windows PowerShell:

- C:\Program Files\WindowsPowerShell\Modules
- User Documents\WindowsPowerShell\Modules

## Importing the Module

If the module is installed to a location listed in $env:PSModulePath, then the module will automatically import whenever trying to use any of the commands. Or you can import manually via:

```Powershell
Import-Module PSAppDeployToolkit
```

If the module is not installed, then you can supply either the path of the module folder or the .psd1 rather than just the module name.

## Creating Deployment Templates

The example deployment templates found in the download can also be generated at any time via the **New-ADTTemplate** command:

```Powershell
# Create a standard v4 template
New-ADTTemplate -Destination C:\Temp -Name Template_v4 -Version 4

# Create a v4 template with additional dlls for PowerShell 7 compatibility
New-ADTTemplate -Destination C:\Temp -Name Template_v4_PSCore -Version 4 -PSCore

# Create a v3 template to use Deploy-Application.ps1 scripts in compatibility mode
New-ADTTemplate -Destination C:\Temp -Name Template_v3 -Version 3
```

## Migration Guidance

### v3 Compatibility Testing

- In **v3**, your **Deploy-Application.ps1** script would dot-source **AppDeployToolkitMain.ps1**, which defined all the functions and variables used by the toolkit.
- In **v4**, **AppDeployToolkitMain.ps1** is no longer required; but if called by a **v3** deployment script, it will import the module and define a series of functions that provide backwards compatibility by remapping the old function names to the new, adjusting any changed parameters automatically. Additionally, it will ensure that session variables such as **$dirFiles** are available directly to use.
- Once you copy your Deploy-Application.ps1 into a PSADT_v4_Template_v3 folder, you will need to ensure any custom settings are migrated from the old **AppDeployToolkitConfig.xml**, to the new **Config\config.psd1** file.
- If required, you should also update any language changes or localization from the old **AppDeployToolkitConfig.xml**, to the new **Strings\strings.psd1** file, as well as any language-specific subfolders.
- Ensure you also copy any custom banner from **AppDeployToolkitBanner.png** to **Assets\Banner.Classic.png**
- Ensure you also copy any custom icon from **AppDeployToolkitLogo.ico** to **Assets\AppIcon.ico**
- Ensure you also copy any custom icon from **AppDeployToolkitLogo.png** to **Assets\AppIcon.png**

## Further Guidance

Note that this is an Insider Preview and as such, documentation is still being completed in advance of the final release. Please feel free to reach out to us on Discord or GitHub with any questions.