MSEndpointMgr / IntuneWin32App

Provides a set of functions to manage all aspects of Win32 apps in Microsoft Intune.
MIT License
351 stars 91 forks source link

Create .intunewin file: WARNING: Unexpected error occurred while packaging Win32 app. Return code from invocation: -532462766 #139

Closed subsense33 closed 8 months ago

subsense33 commented 10 months ago

When attempting to follow the instructions provided in the GitHub repository

https://github.com/MSEndpointMgr/IntuneWin32App?tab=readme-ov-file#package-application-source-files-into-win32-app-package-intunewin

For packaging application source files into a Win32 app package using New-IntuneWin32AppPackage, I consistently encounter the following error:

WARNING: Unexpected error occurred while packaging Win32 app. Return code from invocation: -532462766 I'm using the exact code as outlined in the readme.md:

# Package MSI as .intunewin file
$SourceFolder = "C:\Win32Apps\Source\7-Zip"
$SetupFile = "7z1900-x64.msi"
$OutputFolder = "C:\Win32Apps\Output"
New-IntuneWin32AppPackage -SourceFolder $SourceFolder -SetupFile $SetupFile -OutputFolder $OutputFolder -Verbose

If you have any insights into resolving this issue or if there are additional steps to consider, I would greatly appreciate your assistance.

Tested on multiple devices.

error

subsense33 commented 10 months ago

Tested several version of IntuneWinAppUtil.exe They all produce the same error. No issues running IntuneWinAppUtil.exe standalone

soldier9945 commented 10 months ago

Hello,

I just researched this for the 3rd time as I have automation that uploads apps in a script. The last 2 times I had to change code in the module itself or some people here had to change to an older IntuneWInAppUtil.exe version as you have tried.

I have just upgraded to the Module to version 1.4.3 and specified in my script's first line:

#requires -Modules @{ ModuleName="IntuneWin32App"; RequiredVersion="1.4.3" }

I am currently executing this script with: PSVersion 7.3.10 PSEdition Core

I haven't changed anything after upgrading the module. I hope this helps you as well.

subsense33 commented 10 months ago

Thanks, for now I solved this by directly IntuneWinAppUtil.exe from my PoweShell script. Not as nice as downloaden the most recent version, but is does the job

That-Annoying-Guy commented 9 months ago

I think this is related to Issue https://github.com/MSEndpointMgr/IntuneWin32App/issues/134 New-IntuneWin32AppPackage uses the module's Invoke-Executable function.

Supposedly there will be a fix in 1.4.4 but I see nothing yet.

NickolajA commented 8 months ago

1.4.4 is out now, please verify if the issue still persist. Reopen the issue if there's still a problem :)