Long story short:
I need Intune to execute the following exact command inside PowerShell:
powershell.exe .\VLTUninstall.ps1
This must run exactly as written, because the uninstall script uses a decryption key and only works when executed in this specific form. (powershell.exe + script)
I’m deploying through Intune as a Win32 app using:
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
have also tried
Invoke-AppDeployToolkit.exe -DeploymentType Install
Inside PSADT I call:
Start-ADTProcess -FilePath "$PSHOME\powershell.exe" -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command "powershell.exe .\VLTUninstall.ps1"' -WorkingDirectory $adtSession.DirFiles
Diagnostics show that Intune is correctly running in 64‑bit, as SYSTEM, with FullLanguage:
PSHome: C:\Windows\System32\WindowsPowerShell\v1.0
PSVersion: 5.1.26100.7462
Is64BitProcess: True
LanguageMode: FullLanguage
Locally the script runs fine and uninstalls Zscaler without issues.
Through Intune, the script “runs”, returns exit code 0, but the app is not removed, services and folders remain, no errors surface unless I manually force logging.
The uninstall script logs this error message:
powershell.exe : Exception calling "ReadVault" with "0" argument(s): "Unable to load DLL 'DataVault.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
but the module is there
Info: I reproduce the same error message locally by running the VLTUninstall.ps1 without powershell.exe in front of it.
Windows PowerShell
#correct command
powershell.exe .\VLTUninstall.ps1
#Bad execution command; will trigger Exception from HRESULT: 0x8007007E)
.\VLTUninstall.ps1 or & .\VLTUninstall.ps1
I've tried also to move the files in C:\Program Files and execute the script from that directory. That didn't work either. I'm really running out of options, and I don't know if I'm doing something wrong. I've spent hours with GPT, Copilot and tried multiple execution commands inside PSADT for this uninstall script, but nothing worked.
I’m aware of the usual SYSTEM vs local user context differences but what I still don't understand what is going on and I’m looking for insight into why nested PowerShell commands behave differently under Intune and how to correctly force Intune/PSADT to run a script exactly in this form.
If anyone can identify what I’m doing incorrectly or has any suggestions to resolve this issue, I would greatly appreciate your input.
