Hi,
Thank you for posting in Microsoft Q&A forum.
1,The error "the system cannot find the file specified. (0x80070002)" indicates that the file specified in the command or script does not exist or may be in use by another process.
In the provided script, the error could be caused by the line $wingetPath = "$($wingetApp.InstallLocation)\winget.exe" where the script tries to access the "winget.exe" file from the InstallLocation of the "Microsoft.DesktopAppInstaller". Make sure that the file is present in the location specified or try reinstalling "Microsoft.DesktopAppInstaller" if it is missing.
It could also help to check the permissions for the file and the path in the script and ensure that they are set correctly.
2,Additionally, you can check the Intune management console for any logs or specific error messages to help pinpoint the issue.
Troubleshooting Intune app installation issues
Thanks for your time. Have a nice day!
Best regards,
Simon
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.