Open ThomasSteendijk opened 11 months ago
Same issue, confirmed. Good work on the quick PR!
Can confirm the issue as well. Thanks @ThomasSteendijk
Same issue.
Same issue
The issue is not with IntuneWin32App, but with the new version of IntuneWinAppUtil.exe v1.8.5. invoke-execution.ps1 tries to run the app without the console visible, so we hit this issue: https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool/issues/111. Made a temp workaround to get the old v1.8.4 version and add it to the "$env:temp" path as a workaround until intunewin32apputil.exe is fixed.
A successful workaround for me with the current IntuneWin32App module v1.4.2 and the current (broken) IntuneWinAppUtil.exe v1.8.5 (file version 6.2312.30.0) is as follows. Modify \PowerShell\Modules\IntuneWin32App\1.4.2\Private\Invoke-Executable.ps1. Change lines 15 - 18 from:
$ProcessStartInfoObject.CreateNoWindow = $true
$ProcessStartInfoObject.UseShellExecute = $false
$ProcessStartInfoObject.RedirectStandardOutput = $true
$ProcessStartInfoObject.RedirectStandardError = $true
to
$ProcessStartInfoObject.CreateNoWindow = $false
$ProcessStartInfoObject.UseShellExecute = $true
$ProcessStartInfoObject.RedirectStandardOutput = $false
$ProcessStartInfoObject.RedirectStandardError = $false
This causes IntuneWinAppUtil.exe to run in a visible command shell window without I/O redirection, but it does run successfully.
See IntuneWinAppUtil.exe cannot be launched from c# code without console visible #111 to track the problem with IntuneWinAppUtil.exe.
Retracting this workaround for now. While the intunewin files are successfully created, and based on Expand-IntuneWin32AppPackage, they appear to be correct, Intune app creation is failing with the following error messages:
WARNING: Intune service request for operation 'CommitFile' failed
WARNING: Failed to create Win32 app, commit file request operation failed
A successful workaround for me with the current IntuneWin32App module v1.4.2 and the current (broken) IntuneWinAppUtil.exe v1.8.5 (file version 6.2312.30.0) is as follows. Modify \PowerShell\Modules\IntuneWin32App\1.4.2\Private\Invoke-Executable.ps1. Change lines 15 - 18 from:
$ProcessStartInfoObject.CreateNoWindow = $true $ProcessStartInfoObject.UseShellExecute = $false $ProcessStartInfoObject.RedirectStandardOutput = $true $ProcessStartInfoObject.RedirectStandardError = $true
to
$ProcessStartInfoObject.CreateNoWindow = $false $ProcessStartInfoObject.UseShellExecute = $true $ProcessStartInfoObject.RedirectStandardOutput = $false $ProcessStartInfoObject.RedirectStandardError = $false
This causes IntuneWinAppUtil.exe to run in a visible command shell window without I/O redirection, but it does run successfully.
See IntuneWinAppUtil.exe cannot be launched from c# code without console visible #111 to track the problem with IntuneWinAppUtil.exe.
Same error with the workaround provided by @ThomasSteendijk.
WARNING: Intune service request for operation 'CommitFile' failed
WARNING: Failed to create Win32 app, commit file request operation failed
Speculating that this may be a problem with Microsoft.Graph. Currently using v2.9.1.
Retested this with different version of various components. Works with PowerShell 7.39, Microsoft.Graph 2.91, IntuneWinAppUtil.exe 1.85, and IntuneWin32App 1.42 with the visible window workaround applied. Fails when PowerShell is upgraded to 7.40 with the 'CommitFIle' error as above. Seems like this is a separate problem. Opened issue Add-IntuneWin32App.ps1 'CommitFile' failed error with PowerShell 7.4.0 #128.
For those automating this through things like Github Runners, I added this Invoke-Webrequest to download the older IntuneWinAppUtil.exe file to the $env:temp directory. That way this module would detect the file I downloaded instead.
Invoke-WebRequest -URI "https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool/raw/1a00a2a786de646c5fc46d6e1b79988c636e764e/IntuneWinAppUtil.exe" -outfile "$env:TEMP\IntuneWinAppUtil.exe"
$output = New-Item -Path "Remote Desktop" -ItemType "directory" -Name "Output"
New-IntuneWin32AppPackage -SourceFolder "Remote Desktop\Input" -SetupFile "Install-Remote-Desktop.ps1" -OutputFolder $output -Verbose
Since this morning (03/11/2023) the creation of intune files seem to have broken using both the current version and old versions of IntuneWin32App.
When using the app to create a intunefile (".intunewin") it fails.
Issue detected on: Version: Live and old versions (1.4.1 + 1.4.0) Computer: Windows 10, windows 11. Clean image. Local machine, Windows VM, Azure VM, Azure devops pipeline
Example:
Source of issue: "...\IntuneWin32App\Public\New-IntuneWin32AppPackage.ps1" R:102
"$PackageInvocation = Invoke-Executable -FilePath $IntuneWinAppUtilPath -Arguments "-c ""$($SourceFolder)"" -s ""$($SetupFile)"" -o ""$($OutPutFolder)"" -q""
Invoke-Executable does nolonger seems to work correctly.
Solution: Replace Invoke-Executable with a normal start-process