Forum Discussion
dilanmic
Dec 15, 2024Iron Contributor
Proactive Remediation in Intune doesn't pick up special characters
Hi All,
I have a remediation script to uninstall an application. However, that will throw an error message even though it runs on PowerShell manually without an issue. Based on my troubleshooting, it seems remediation script doesn't identify the special characters contents in the file path. I would really appreciate it your help if anyone come across this before.
surprisingly, although it gives an error, the command is executing and application is uninstalling without and issue. But I am curious to get rid of the error message for reporting purpose.
Below is the command executing:
Start-Process "C:\ProgramData\Package Cache\{7b06c930-fc32-47a7-8bea-5f1fb6099ee8}\elliptic_virtual_lock_sensor.exe" /uninstall /quiet -Wait
Error message:
Troubleshooting methods tried so far:
- Use cmd.exe '/C', instead of start-process.
- Used file path with start-process (Start-Process -Filepath ...... )
- Add error action as either ignored or silently continue, but it still give an error in Intune.
- Start-Process "C:\ProgramData\Package Cache\{7b06c930-fc32-47a7-8bea-5f1fb6099ee8}\elliptic_virtual_lock_sensor.exe" /uninstall /quiet -Wait -erroraction silentlycontinue
- Start-Process "C:\ProgramData\Package Cache\{7b06c930-fc32-47a7-8bea-5f1fb6099ee8}\elliptic_virtual_lock_sensor.exe" /uninstall /quiet -Wait -erroraction ignore
- Used backtick ( ` ) with special characters ( { and } ). below is the command used. whenever I used this bactick ( `) it didn't work the script at all.
- Start-Process "C:\ProgramData\Package Cache\`{7b06c930-fc32-47a7-8bea-5f1fb6099ee8`}\elliptic_virtual_lock_sensor.exe" /uninstall /quiet -Wait
Thanks advance,
Dilan
- jvsimoesCopper Contributor
I am having a similar issue, did you ever find a way to handle this? In my case, it seems to be upset that our path uses accentuation (^, ~)
- dilanmicIron Contributor
I didn't have time to test it further since I got the desired result in my case. However, I was wondering it may be something with PowerShell version. Can you change it to 64bit and see.
- jvsimoesCopper Contributor
Hey thanks for the reply! I actually fixed it by copying the code to Notepad++, changing the encoding to UTF-8-BOM and saving it. After this I reuploaded the script to Intune and it ran fine.
did you also used a double {{ }}