Page 1 of 1

PowerShell script variable %appdata% on the logged-in user's profile

Published: May 2, 2022 - 10:10 AM
by Guillaume_ccfd
Hello,

I want to create a package containing a variable to delete certain folders from the logged-in user profile, and I'm a bit stuck on which variable to use.

If I use ` run_powershell('remove-item "$env:APPDATA\directory1")`, the risk is that the script will run on the "user system" profile and not the "connected user" profile.

Do you have any ideas?

Re: PowerShell script variable %appdata% on the logged-in user's profile

Published: May 5, 2022 - 7:31 PM
by dcardon
Why use PowerShell when you have setuphelpers?

Code: Select all

user_appdata() -> %appdata%/roaming
user_local_appdata()  -> %appdata%/local


Sincerely,

Denis