Skip to content

Commit 93f97b8

Browse files
committed
Updates module to version 0.3.0
- Updates the module to version 0.3.0 and requires PSAppDeployToolkit 4.1.0 - Adds the ability to migrate v3 XML configuration settings to the v4 config.psd1. - Updates Convert-ADTDeployment to handle additional $adtSession variables introduced in PSADT 4.1. - Adds special handling of DeployMode and Show-InstallationWelcome's -CloseApps parameter migration.
1 parent 342be7e commit 93f97b8

File tree

6 files changed

+226
-52
lines changed

6 files changed

+226
-52
lines changed

CHANGELOG.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-

1+
PSAppDeployToolkit.Tools Change Log
2+
=====================================
3+
4+
## [0.3.0] - 2025-07-29
5+
6+
- Added the ability to migrate v3 XML configuration settings to the v4 config.psd1
7+
- Updated Convert-ADTDeployment to additional $adtSession variables introduced in PSADT 4.1:
8+
- appSuccessExitCodes, appRebootExitCodes, appProcessesToClose
9+
- requireAdmin, deployAppScriptFriendlyName, deployAppScriptVersion
10+
- Added special handling of DeployMode migration
11+
- If set to Interactive, the setting is not migrated. This is so that the migrated script adopts the default DeployMode, which is now Auto
12+
- All other values are migrated to $adtSession.DeployMode
13+
- Added special handling of Show-InstallationWelcome's -CloseApps parameter to migrate to $adtSession.appProcessesToClose
14+
- Supports both simple names ("notepad,excel") and name=description pairs ("notepad=Notepad,excel=Microsoft Excel")
15+
- Converts to correct hashtable format
16+
- Updated module manifest to require PSAppDeployToolkit 4.1.0 (previously 4.0.5)
17+
- Updated ImportsFirst.ps1 to use PSAppDeployToolkit 4.1.0 requirement
18+
19+
## [0.2.3] - 2024-12-03
20+
21+
### Initial Features
22+
- Convert-ADTDeployment: Convert PSAppDeployToolkit v3 scripts and packages to v4 format
23+
- Test-ADTCompatibility: Test v3 scripts for compatibility issues with v4
24+
- Custom PSScriptAnalyzer rules for PSADT compatibility checking

README.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
# ![PSAppDeployToolkit.Tools](https://github.com/user-attachments/assets/a275b3f9-6a45-42f0-a377-a57036d3f84d)
22

3-
## Enterprise App Packaging, Extended.
3+
## 🚀 Enterprise App Packaging, Extended
44

55
PSAppDeployToolkit.Tools is a companion module for [PSAppDeployToolkit](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit) that provides tools and functions useful during the application packaging process. Having this separate allows for a separate release schedule and also reduces the file size of the module that is required to be delivered to endpoints to handle software deployments.
66

7-
### Features
7+
### ✨ Key Features
88

9-
- **Test-ADTCompatibility** - Test your PSAppDeployToolkit v3 scripts to get a full report on which functions and variables have changed in v4.
10-
- **Convert-ADTDeployment** - Convert a PSAppDeployToolkit v3 script or an entire package folder to v4 standards.
9+
- **Test-ADTCompatibility** - Test your PSAppDeployToolkit v3 scripts to get a full report on which functions and variables have changed in v4.1.
10+
- **Convert-ADTDeployment** - Convert a PSAppDeployToolkit v3 script or an entire package folder to v4.1 standards.
1111

12-
## Getting Started
12+
## 🚀 Getting Started
13+
14+
### Prerequisites
15+
16+
- Windows 10/11
17+
- PowerShell 5.1 or later
18+
- .NET Framework 4.7.2 or later
19+
20+
### Installing The Module
1321

1422
Install the module from the PowerShell Gallery:
1523

1624
```powershell
1725
Install-Module PSAppDeployToolkit.Tools -Scope CurrentUser -AllowPreRelease
1826
```
1927

20-
If this produces an error that the `-AllowPreRelease` parameter is not recognised, then first update PowerShellGet and then restart your PowerShell console:
28+
If this produces an error that the `-AllowPreRelease` parameter is not recognized, then first update PowerShellGet and then restart your PowerShell console:
2129

2230
```powershell
2331
Install-Module PowerShellGet -Force -Scope CurrentUser
@@ -49,22 +57,29 @@ Convert-ADTDeployment -Path .\PackageFolder
4957

5058
This example converts PackageFolder into PackageFolder_Converted in the same folder.
5159

52-
### PSAppDeployToolkit Links
60+
## 📄 License
61+
62+
This project is licensed under the [GNU Lesser General Public License](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/blob/main/COPYING.Lesser)
63+
64+
## Important Links
5365

54-
-> [Homepage](https://psappdeploytoolkit.com)
55-
-> [Documentation](https://psappdeploytoolkit.com/docs)
56-
-> [Function & Variable References](https://psappdeploytoolkit.com/docs/reference)
57-
-> [Download Latest Release](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases)
58-
-> [News](https://psappdeploytoolkit.com/blog)
66+
### PSAppDeployToolkit
5967

60-
### Community Links
68+
- [Homepage](https://psappdeploytoolkit.com)
69+
- [Latest News](https://psappdeploytoolkit.com/blog)
70+
- [Documentation](https://psappdeploytoolkit.com/docs/introduction)
71+
- [Function & Variable References](https://psappdeploytoolkit.com/docs/reference)
72+
- [PowerShell Gallery](https://www.powershellgallery.com/packages/PSAppDeployToolkit)
73+
- [GitHub Releases](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases)
6174

62-
-> [Discourse Forum](https://discourse.psappdeploytoolkit.com/)
63-
-> [Discord Chat](https://discord.com/channels/618712310185197588/627204361545842688)
64-
-> [Reddit](https://reddit.com/r/psadt)
75+
### Community
6576

66-
## License
77+
- [Discourse Forum](https://discourse.psappdeploytoolkit.com/)
78+
- [Discord Chat](https://discord.com/channels/618712310185197588/627204361545842688)
79+
- [Reddit](https://reddit.com/r/psadt)
6780

68-
The PowerShell App Deployment Tool is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
81+
### GitHub
6982

70-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
83+
- [Issues](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/issues)
84+
- [Security Policy](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/security)
85+
- [Contributor Guidelines](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/blob/main/.github/CONTRIBUTING.md)

src/PSAppDeployToolkit.Tools/ImportsFirst.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PSAppDeployToolkit.Tools - companion module for PSAppDeployToolkit.
66
.DESCRIPTION
77
This module script contains functions to aid enterprise application packaging and the creation of PSAppDeployToolkit deployment scripts.
88
9-
PSAppDeployToolkit is licensed under the GNU LGPLv3 License - (C) 2024 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
9+
PSAppDeployToolkit is licensed under the GNU LGPLv3 License - (C) 2025 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
1010
1111
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the
1212
Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but
@@ -28,7 +28,7 @@ https://psappdeploytoolkit.com
2828
$RequiredModules = [System.Collections.ObjectModel.ReadOnlyCollection[Microsoft.PowerShell.Commands.ModuleSpecification]]$(
2929
@{ ModuleName = 'Microsoft.PowerShell.Management'; Guid = 'eefcb906-b326-4e99-9f54-8b4bb6ef3c6d'; ModuleVersion = '1.0' }
3030
@{ ModuleName = 'Microsoft.PowerShell.Utility'; Guid = '1da87e53-152b-403e-98dc-74d7b4d63d59'; ModuleVersion = '1.0' }
31-
@{ ModuleName = 'PSAppDeployToolkit'; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '3.93.0' }
31+
@{ ModuleName = 'PSAppDeployToolkit'; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.0' }
3232
@{ ModuleName = 'PSScriptAnalyzer'; Guid = 'd6245802-193d-4068-a631-8863a4342a18'; ModuleVersion = '1.23.0' }
3333
)
3434

src/PSAppDeployToolkit.Tools/PSAppDeployToolkit.Tools.psd1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
22
# Module manifest for module 'PSAppDeployToolkit.Tools'
33
#
4-
# Last modified: 2025-01-24
4+
# Last modified: 2025-07-29
55
#
66

77
@{
88
# Script module or binary module file associated with this manifest.
99
RootModule = 'PSAppDeployToolkit.Tools.psm1'
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.2.3'
12+
ModuleVersion = '0.3.0'
1313

1414
# Supported PSEditions
1515
# CompatiblePSEditions = @()
@@ -24,7 +24,7 @@
2424
CompanyName = 'PSAppDeployToolkit Team'
2525

2626
# Copyright statement for this module
27-
Copyright = 'Copyright © 2024 PSAppDeployToolkit Team. All rights reserved.'
27+
Copyright = 'Copyright © 2025 PSAppDeployToolkit Team. All rights reserved.'
2828

2929
# Description of the functionality provided by this module
3030
Description = 'Enterprise App Packaging, Extended.'
@@ -39,7 +39,7 @@
3939
PowerShellHostVersion = '5.1.14393.0'
4040

4141
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
42-
DotNetFrameworkVersion = '4.6.2.0'
42+
DotNetFrameworkVersion = '4.7.2.0'
4343

4444
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
4545
CLRVersion = '4.0.30319.42000'
@@ -49,7 +49,7 @@
4949

5050
# Modules that must be imported into the global environment prior to importing this module
5151
RequiredModules = @(
52-
@{ModuleName = 'PSAppDeployToolkit'; GUID = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.0.5'; }
52+
@{ModuleName = 'PSAppDeployToolkit'; GUID = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.0'; }
5353
@{ModuleName = 'PSScriptAnalyzer'; GUID = 'd6245802-193d-4068-a631-8863a4342a18'; ModuleVersion = '1.23.0'; }
5454
)
5555

src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1

Lines changed: 124 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<#
1+
<#
22
.SYNOPSIS
3-
PSSCriptAnalyzer rules to check for usage of legacy PSAppDeployToolkit v3 commands or variables.
3+
PSScriptAnalyzer rules to check for usage of legacy PSAppDeployToolkit v3 commands or variables.
44
.DESCRIPTION
5-
Can be used directly with PSSCriptAnalyzer or via Test-ADTCompatibility and Convert-ADTDeployment functions.
5+
Can be used directly with PSScriptAnalyzer or via Test-ADTCompatibility and Convert-ADTDeployment functions.
66
.EXAMPLE
77
Measure-ADTCompatibility -ScriptBlockAst $ScriptBlockAst
88
.INPUTS
@@ -1894,6 +1894,7 @@ function Measure-ADTCompatibility
18941894
"-CloseProcesses $closeProcesses"
18951895
}
18961896
}
1897+
18971898
}
18981899
'Get-WindowTitle' = @{
18991900
'NewFunction' = 'Get-ADTWindowTitle'
@@ -2552,6 +2553,46 @@ function Measure-ADTCompatibility
25522553
xmlUIMessages = $null
25532554
}
25542555

2556+
$configMappings = @{
2557+
# XML Config variables to Get-ADTConfig equivalents
2558+
configBalloonTextComplete = '(Get-ADTStringTable).BalloonText.Complete'
2559+
configBalloonTextError = '(Get-ADTStringTable).BalloonText.Error'
2560+
configBalloonTextFastRetry = '(Get-ADTStringTable).BalloonText.FastRetry'
2561+
configBalloonTextRestartRequired = '(Get-ADTStringTable).BalloonText.RestartRequired'
2562+
configBalloonTextStart = '(Get-ADTStringTable).BalloonText.Start'
2563+
configToolkitCompressLogs = '(Get-ADTConfig).Toolkit.CompressLogs'
2564+
configToolkitLogMaxHistory = '(Get-ADTConfig).Toolkit.LogMaxHistory'
2565+
configToolkitLogMaxSize = '(Get-ADTConfig).Toolkit.LogMaxSize'
2566+
configToolkitLogPath = '(Get-ADTConfig).Toolkit.LogPath'
2567+
configToolkitLogStyle = '(Get-ADTConfig).Toolkit.LogStyle'
2568+
configToolkitLogWriteToHost = '(Get-ADTConfig).Toolkit.LogWriteToHost'
2569+
configToolkitRegPath = '(Get-ADTConfig).Toolkit.RegPath'
2570+
configToolkitTempPath = '(Get-ADTConfig).Toolkit.TempPath'
2571+
configMSIInstallParams = '(Get-ADTConfig).MSI.InstallParams'
2572+
configMSISilentParams = '(Get-ADTConfig).MSI.SilentParams'
2573+
configMSIUninstallParams = '(Get-ADTConfig).MSI.UninstallParams'
2574+
configMSILoggingOptions = '(Get-ADTConfig).MSI.LoggingOptions'
2575+
configMSILogPath = '(Get-ADTConfig).MSI.LogPath'
2576+
configMSIMutexWaitTime = '(Get-ADTConfig).MSI.MutexWaitTime'
2577+
configUIDefaultTimeout = '(Get-ADTConfig).UI.DefaultTimeout'
2578+
configUIBalloonNotifications = '(Get-ADTConfig).UI.BalloonNotifications'
2579+
configUILanguageOverride = '(Get-ADTConfig).UI.LanguageOverride'
2580+
configUIDialogStyle = '(Get-ADTConfig).UI.DialogStyle'
2581+
configUIFluentAccentColor = '(Get-ADTConfig).UI.FluentAccentColor'
2582+
configUIPromptToSaveTimeout = '(Get-ADTConfig).UI.PromptToSaveTimeout'
2583+
configUIRestartPromptPersistInterval = '(Get-ADTConfig).UI.RestartPromptPersistInterval'
2584+
configAssetsBanner = '(Get-ADTConfig).Assets.Banner'
2585+
configAssetsLogo = '(Get-ADTConfig).Assets.Logo'
2586+
configAssetsLogoDark = '(Get-ADTConfig).Assets.LogoDark'
2587+
# Legacy XML config access patterns
2588+
xmlConfigToolkitCompressLogs = '(Get-ADTConfig).Toolkit.CompressLogs'
2589+
xmlConfigToolkitLogMaxHistory = '(Get-ADTConfig).Toolkit.LogMaxHistory'
2590+
xmlConfigToolkitLogMaxSize = '(Get-ADTConfig).Toolkit.LogMaxSize'
2591+
xmlConfigToolkitLogPath = '(Get-ADTConfig).Toolkit.LogPath'
2592+
xmlConfigMSIOptions = '$null # XML MSI options are now in (Get-ADTConfig).MSI'
2593+
xmlConfigUIOptions = '$null # XML UI options are now in (Get-ADTConfig).UI'
2594+
}
2595+
25552596
$spBinder = [System.Management.Automation.Language.StaticParameterBinder]
25562597
}
25572598

@@ -2566,6 +2607,13 @@ function Measure-ADTCompatibility
25662607
}
25672608
[System.Management.Automation.Language.Ast[]]$variableAsts = $ScriptBlockAst.FindAll($variablePredicate, $true)
25682609

2610+
# Get legacy config variables
2611+
[ScriptBlock]$configPredicate = {
2612+
param ([System.Management.Automation.Language.Ast]$Ast)
2613+
$Ast -is [System.Management.Automation.Language.VariableExpressionAst] -and $Ast.Parent -isnot [System.Management.Automation.Language.ParameterAst] -and $Ast.VariablePath.UserPath -in $configMappings.Keys
2614+
}
2615+
[System.Management.Automation.Language.Ast[]]$configAsts = $ScriptBlockAst.FindAll($configPredicate, $true)
2616+
25692617
# Get legacy functions
25702618
[ScriptBlock]$commandPredicate = {
25712619
param ([System.Management.Automation.Language.Ast]$Ast)
@@ -2749,6 +2797,17 @@ function Measure-ADTCompatibility
27492797
$variableName = $variableAst.VariablePath.UserPath
27502798
$newVariable = $variableMappings[$variableName]
27512799

2800+
# Special handling for DeployMode = 'Interactive' - don't suggest migration
2801+
if ($variableName -eq 'DeployMode' -and $variableAst.Parent -is [System.Management.Automation.Language.AssignmentStatementAst])
2802+
{
2803+
$assignmentValue = $variableAst.Parent.Right.Extent.Text.Trim().Trim("'", '"')
2804+
if ($assignmentValue -eq 'Interactive')
2805+
{
2806+
# Skip suggesting migration for Interactive values
2807+
continue
2808+
}
2809+
}
2810+
27522811
if ([string]::IsNullOrWhiteSpace($newVariable))
27532812
{
27542813
$outputMessage = "The variable [`$$variableName] is deprecated and no longer available."
@@ -2808,7 +2867,68 @@ function Measure-ADTCompatibility
28082867
}
28092868
}
28102869

2811-
# 3. Redefine legacy functions
2870+
# Process all legacy config variables third
2871+
foreach ($configAst in $configAsts)
2872+
{
2873+
$configVariableName = $configAst.VariablePath.UserPath
2874+
$newConfig = $configMappings[$configVariableName]
2875+
2876+
if ([string]::IsNullOrWhiteSpace($newConfig))
2877+
{
2878+
$outputMessage = "The config variable [`$$configVariableName] is deprecated and no longer available."
2879+
$suggestedCorrections = $null
2880+
}
2881+
else
2882+
{
2883+
if ($newConfig -match 'Get-ADTConfig')
2884+
{
2885+
$outputMessage = "The config variable [`$$configVariableName] is now accessed via the configuration system. Use [$newConfig] instead."
2886+
}
2887+
elseif ($newConfig -match 'Get-ADTStringTable')
2888+
{
2889+
$outputMessage = "The config variable [`$$configVariableName] is now accessed via the string table. Use [$newConfig] instead."
2890+
}
2891+
else
2892+
{
2893+
$outputMessage = "The config variable [`$$configVariableName] is deprecated. Use [$newConfig] instead."
2894+
}
2895+
2896+
if ($newConfig -like '*.*' -and $configAst.Parent.StringConstantType -in [System.Management.Automation.Language.StringConstantType]'DoubleQuoted', [System.Management.Automation.Language.StringConstantType]'DoubleQuotedHereString')
2897+
{
2898+
# Wrap variable in $() if it contains a . and is used in a double-quoted string
2899+
$newConfig = "`$($newConfig)"
2900+
}
2901+
2902+
# Create a CorrectionExtent object for the suggested correction
2903+
$objParams = @{
2904+
TypeName = 'Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.CorrectionExtent'
2905+
ArgumentList = @(
2906+
$configAst.Extent.StartLineNumber
2907+
$configAst.Extent.EndLineNumber
2908+
$configAst.Extent.StartColumnNumber
2909+
$configAst.Extent.EndColumnNumber
2910+
$newConfig
2911+
$MyInvocation.MyCommand.Definition
2912+
'More information: https://psappdeploytoolkit.com/docs/reference/config-settings'
2913+
)
2914+
}
2915+
$correctionExtent = New-Object @objParams
2916+
$suggestedCorrections = New-Object System.Collections.ObjectModel.Collection[$($objParams.TypeName)]
2917+
$suggestedCorrections.Add($correctionExtent) | Out-Null
2918+
}
2919+
2920+
# Output the diagnostic record in the format expected by the ScriptAnalyzer
2921+
[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord]@{
2922+
Message = $outputMessage
2923+
Extent = $configAst.Extent
2924+
RuleName = 'Measure-ADTCompatibility'
2925+
Severity = 'Warning'
2926+
RuleSuppressionID = 'ADTCompatibilitySuppression'
2927+
SuggestedCorrections = $suggestedCorrections
2928+
}
2929+
}
2930+
2931+
# Redefine legacy functions last
28122932
foreach ($commandAst in $commandAsts)
28132933
{
28142934
$functionName = $commandAst.GetCommandName()

0 commit comments

Comments
 (0)