You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this is the correct repository for opening this issue.
I have verified no other issues exist related to my problem.
I have verified this is not an issue for a specific package.
I have verified this issue is not security related.
I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
I am invoking a script via Install-BoxstarterPackage from within BoxstarterShell in Windows-11 24h2. The script contains usage of Get-AppxPackage module to find packaged windows apps.
This is giving ERROR: The type initializer for '<Module>' threw an exception.. If I use this command Get-AppxPackage directly in powershell or Boxstarter shell it works correctly. It only gives above error when invoked via Install-BoxstarterPackage from within BoxstarterShell
I have confirmed that it seems to happen with Windows 11 24H2. It is working fine in Windows 11 23H2.
What is Expected?
Command to work normally in script being invoked by Install-BoxstarterPackage
How Did You Get This To Happen?
Create a script with following content in file called script.ps1
echo "here"Get-AppxPackage
echo "here2"
Enter boxstartershell by typing BoxStarterShell.bat
Run Install-BoxstarterPackage .\script.ps1
System Details
Operating System: Windows 11 24h2
Windows PowerShell version: 5.1.26100 rev 1882
Chocolatey CLI Version: 2.3.0
Chocolatey Licensed Extension version:
Chocolatey License type:
Terminal/Emulator: Powershell
Boxstarter version: 3.0.3
Installed Packages
tmp* packages in below list are all other that are installed as part of my automation script. This command Get-AppxPackage is also part of them. It used to work correctly few months ago. Not sure other than 24h2, if anything else has changed that caused it e.g. boxstarter version
Boxstarter: Installing package .\tools\ChocolateyInstall.ps1
Boxstarter Version 3.0.3.0
(c) 2018 Chocolatey Software, Inc, 2012 - 2018 Matt Wrock. https://boxstarter.org
Boxstarter: Disabling Automatic Updates from Windows Update
Chocolatey v2.3.0
Attempting to build package from 'tmp6132.tmp.nuspec'.
Successfully created package 'C:\ProgramData\Boxstarter\BuildPackages\tmp6132.tmp.1.0.0.nupkg'
Boxstarter: Created a temporary package tmp6132.tmp from .\tools\ChocolateyInstall.ps1 in C:\ProgramData\Boxstarter\BuildPackages
+++ Boxstarter starting Calling Chocolatey to install tmp6132.tmp. This may take several minutes to complete...
Chocolatey v2.3.0
Installing the following packages:
tmp6132.tmp
By installing, you accept licenses for the packages.
Downloading package from source'C:\ProgramData\Boxstarter\BuildPackages'
tmp6132.tmp v1.0.0 (forced)
tmp6132.tmp package files install completed. Performing other installation steps.
*** LOADING BOXSTARTER ***
Boxstarter: *** HELLO WORLD ***
here
ERROR: The type initializer for'<Module>' threw an exception.
The install of tmp6132.tmp was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\tmp6132.tmp\tools\ChocolateyInstall.ps1'.
See log for details.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- tmp6132.tmp (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\tmp6132.tmp\tools\ChocolateyInstall.ps1'.
See log for details.
+++ Boxstarter finished Calling Chocolatey to install tmp6132.tmp. This may take several minutes to complete... 00:00:34.4755333
True
Boxstarter: Restore Automatic Updates from Windows Update
Errors : {}
ComputerName : localhost
Completed : True
FinishTime : 10/21/2024 9:02:46 AM
StartTime : 10/21/2024 9:02:09 AM
Additional Context
It is working correctly in Windows 11 23H2, so something in Windows 11 24H2 is causing Install-BoxstarterPackage to fail for this particular command
The text was updated successfully, but these errors were encountered:
Checklist
What You Are Seeing?
I am invoking a script via
Install-BoxstarterPackage
from within BoxstarterShell in Windows-11 24h2. The script contains usage ofGet-AppxPackage
module to find packaged windows apps.This is giving
ERROR: The type initializer for '<Module>' threw an exception.
. If I use this commandGet-AppxPackage
directly in powershell or Boxstarter shell it works correctly. It only gives above error when invoked viaInstall-BoxstarterPackage
from within BoxstarterShellI have confirmed that it seems to happen with Windows 11 24H2. It is working fine in Windows 11 23H2.
What is Expected?
Command to work normally in script being invoked by
Install-BoxstarterPackage
How Did You Get This To Happen?
script.ps1
BoxStarterShell.bat
Install-BoxstarterPackage .\script.ps1
System Details
Installed Packages
tmp* packages in below list are all other that are installed as part of my automation script. This command
Get-AppxPackage
is also part of them. It used to work correctly few months ago. Not sure other than 24h2, if anything else has changed that caused it e.g. boxstarter versionOutput Log
Contents of .\tools\ChocolatelyInstall.ps1
Output it produced
Additional Context
It is working correctly in Windows 11 23H2, so something in Windows 11 24H2 is causing
Install-BoxstarterPackage
to fail for this particular commandThe text was updated successfully, but these errors were encountered: