Forum Discussion
oryxway
Sep 22, 2023Iron Contributor
Powershell script while uploading shows error
I have everything correct. but these characters are appearing here which is causing me to not go to the next step in Intune after detection. This is basically checking
Any update?
oryxway
Sep 25, 2023Iron Contributor
Hi Harm,
Thanks again coming to answer my posting. So, when I copy and paste my Powershell script in the Detection section of Intune to detect the version while pushing an app, I see that it has added 2 or 3 characters in the front, I remember this happened to me before but I do not remember how I solved the problem. Do you see the three characters I have highlighted on the first line before # Custom detection script............................. Those three characters being there is not allowing me to the NEXT screen in order to add the app which has been packaged to be pushed through Intune.
Thanks again coming to answer my posting. So, when I copy and paste my Powershell script in the Detection section of Intune to detect the version while pushing an app, I see that it has added 2 or 3 characters in the front, I remember this happened to me before but I do not remember how I solved the problem. Do you see the three characters I have highlighted on the first line before # Custom detection script............................. Those three characters being there is not allowing me to the NEXT screen in order to add the app which has been packaged to be pushed through Intune.
- Sep 25, 2023
You select Use a custom detection script, browse to the .ps1 file (Which, if you open it in Notepad, doesn't have those characters), and after uploading, it does have those characters present. I never saw that before myself.
Could you add a blank line at the start of the script, save it, and try it again? It seems like an encoding issue...- oryxwaySep 25, 2023Iron ContributorI think it worked for me prior to this. I am not sure what happened before. But, I was able to upload it without any issues.
- Sep 25, 2023
Not sure either. It could be copying/pasting it from a website or other file. Could you copy/paste it to Notepad and save it again to a .ps1 file?