Skip to content

[Bug] All custom variables are stripped from app Variables v3 to v4 #8

Open
@digiman57

Description

@digiman57

Prerequisites

PSAppDeployToolkit.Tools version

0.2.2

PSAppDeployToolkit version

4.04

Describe the bug

Win10 VMware VM. I converted a couple v3 scripts that had string variables similar to built in variables (all listed under AppScriptAuthor) , such as [string]$MSIName1 = 'MSI_Name', etc.
The built in variables are the only variables to show up in the converted v4 script. 2nd problem, is none of these extra or custom variables in the head of the old v3 script are set to the new switch, down in the sections of the script. Ex: #MSIName1 should be converted to $adtSession.MSIName1, but the variable shows up like this, $MSIName1. My scripts can contain up to 18 custom variables (as I really only had to file data in the variables and rarely touch the script. I had if statements thoughout the different sections that used the custom variables at the head, and would even use them in the fuctions, such as $InstallTime in the line for Show-InstallationProgress. That variable is there in the line, without the new formatting, but it is also missing in the head of the script as the custom variables were stripped out.

Steps to reproduce

  1. I installed the latest ADT toolkit in a powershell console and also installed the Tools modules as of 1-11-25
  2. I ran Convert-ADTDeployment and converted a template v.3.10.2 script and later a full blown app script
  3. The invoke-AppDeployToolkit.ps1 in each case were missing all the custom variables at the head and inside the pre, install, post, etc. sections, the custom variables were lacking the new format form.

Environment data

OsName               : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsProductName   : Windows 10 Enterprise
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
KeyboardLayout       : en-US
TimeZone             : (UTC-06:00) Central Time (US & Canada)
HyperVisorPresent    : True
CsPartOfDomain       : False
CsPCSystemType       : Desktop


Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2
  RID:          win-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.Windows
Desktop.App]
  Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.Windows
Desktop.App]
  Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.Windows
Desktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.Windows
Desktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions