Forum Discussion
PowerShell scripts not delivering to Windows devices
Hello Everyone,
I am trying to push a powershell script from Intune through the Scripts option in Devices and it is working for some devices but not on all the devices. We want to install a msix using the powershell script. Please suggest me here.. There is no issue in the script, we have tested on local machine by running it manually. If i run the script directly in powershell as administrator it will work straight away and install the MSIX. Please help.
2 Replies
- ayla74108Copper Contributor
Hi AvitSoni,
Thanks for sharing the details of your issue. Since the script works fine when run manually but not through Intune on all devices, it might be related to device-specific policies, execution policies, or user context in Intune.
Here are a few things you could check:
Verify that the devices where the script fails have the correct PowerShell execution policy set to allow the script to run.
Make sure the script runs in the system context if needed, not just user context.
Check if there are any Intune compliance policies or restrictions blocking script execution on some devices.
Review Intune’s script logs on the affected devices for errors or hints.Hope this helps! Let me know if you need assistance with any of these steps.
If the installation fails but the script exits successfully (Exit 0), it will not attempt the installation again. But to troubleshoot, you can add Start-Transcript c:\windows\temp\log.txt to the top of the script and Stop-Transcript at the end of the script. Save and upload the modified script, it will rerun on the devices again, so you might want to limit this to the failing device, and check the log afterwards.
You could also try adding the MSIX as a Line-of-Business-App in Windows Apps instead of using a script.