Skip to content

[Bug] PSScriptAnalyzer 1.24.0 Breaks PSAppDeployToolkit.Tools #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
SPatrickStevens opened this issue Apr 24, 2025 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@SPatrickStevens
Copy link

Prerequisites

PSAppDeployToolkit.Tools version

0.2.3

PSAppDeployToolkit version

4.0.6

Describe the bug

If PSAppDeployToolkit.Tools is freshly installed or updated, it installs PSScriptAnalyzer 1.24.0

This is the issue I mentioned in #10 I didn't want to hijack that issue.

This results in the following error when attempting to convert a script:

VERBOSE: Running ScriptAnalyzer fixes on [C:\Users\%username%\AppData\Local\Temp\2\Convert-ADTDeployment_5t51w4bjoep\Deploy-Application.ps1]
VERBOSE: Removing temp folder [C:\Users\%username%\AppData\Local\Temp\2\Convert-ADTDeployment_5t51w4bjoep]
VERBOSE: [2025-04-24T12:28:45.6194727-04:00] [Convert-ADTDeployment] :: The property 'Invoke-ScriptAnalyzer' cannot be found on this object. Verify that the property exists.
Error Record:
-------------

Message               : The property 'Invoke-ScriptAnalyzer' cannot be found on this object. Verify that the property exists.

FullyQualifiedErrorId : PropertyNotFoundStrict,Convert-ADTDeployment
ScriptStackTrace      : at Convert-ADTDeployment<Process>, C:\Users\%username%\Documents\PowerShell\Modules\PSAppDeployToolkit.Tools\0.2.3\PSAppDeployToolkit.Tools.psm1: line 298
                        at <ScriptBlock>, \\cm01\sources$\PowerShell App Deployment Toolkit\v4 Management Scripts\Convert-ADTDeployment(v4).ps1: line 136
                        at <ScriptBlock>, <No file>: line 1

PositionMessage       : At \\cm01\sources$\PowerShell App Deployment Toolkit\v4 Management Scripts\Convert-ADTDeployment(v4).ps1:136 char:13
                        +             Convert-ADTDeployment -Path $Path -Verbose
                        +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am able to force uninstall 1.24.0, force install 1.23.0, then avoid updating the module to get things in a working state.

If module is imported

Remove-Module -Name PSAppDeployToolkit.Tools

Uninstall PSScriptAnalyzer 1.24.0

Get-Module -ListAvailable -Name PSScriptAnalyzer | Where-Object -Property Version -eq 1.24.0 | Uninstall-Module -Force

Install PSScriptAnalyzer 1.23.0

Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -RequiredVersion 1.23.0 -Force

Import modules

Import-Module -Name PSAppDeployToolkit.Tools
Import-Module -Name PSAppDeployToolkit

Steps to reproduce

  1. Install-Module -Name PSAppDeployToolkit -Scope CurrentUser -Force
  2. Install-Module -Name PSAppDeployToolkit.Tools -Scope CurrentUser -AllowPrerelease -Force
  3. Convert-ADTDeployment -Path -Verbose

Environment data

OsName               : Microsoft Windows Server 2025 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsProductName   : Windows Server 2025 Standard
WindowsBuildLabEx    : 26100.1.amd64fre.ge_release.240331-1435
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
KeyboardLayout       : en-US
TimeZone             : (UTC-05:00) Eastern Time (US & Canada)
HyperVisorPresent    : True
CsPartOfDomain       : True
CsPCSystemType       : Desktop


Host:
  Version:      8.0.15
  Architecture: x64
  Commit:       50c4cb9fc3
  RID:          win-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.NETCore.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.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
@SPatrickStevens SPatrickStevens added the bug Something isn't working label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant