$envLocalAppData Redirecting only to System Profile

I am trying to execute the .exe file from User/App Data folder for which I am using the Variable $envLocalAppData which supposed to route us to below path.

$envLocalAppData = %LOCALAPPDATA%, e.g. C:\Users%USERNAME%\AppData\Local

However, $envLocalAppData is only redirecting to System Profile Path and not the Logged In user folder. Even if we try via System Account or Software Center directly

Command Used:

Start-ADTProcessAsUser -FilePath "$envLocalAppData\Programs\com.siemens.healthineers.emea.acttool.testtool\Uninstall ACT-Tool.exe" -ArgumentList "/S"

Actual Path:

image

We're aware. PSAppDeployToolkit has always set these variables up this way, which next to useless. [Feature] Review our $env* variables and decide whether they should represent the user's values. · Issue #1902 · PSAppDeployToolkit/PSAppDeployToolkit · GitHub

I'd just use %LocalAppData% and add -ExpandEnvironmentVariables onto your Start-ADTProcessAsUser call to get you going.

1 Like

Thank you @mjr4077au using -ExpandEnvironmentVariables worked for me.
I tried %LocalAppData% earlier also but not with the this Parameter.

Thank you again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.