SOLVED

Copying files to %appdata% with intune

Copper Contributor

HI All,

 

I have been trying to copy an .ini file though intune to C:\Users\%username%\AppData\Roaming\pyRevit 

 

I have decided to go with PowerShell and below is the following script

 

New-item -itemtype directory -force -path $env:APPDATA\pyRevit

Copy-item -path "$psscriptroot\pyRevit_config.ini" -Destination $env:APPDATA\pyRevit

Return 0

 

below is my Install command in intune

 

powershell.exe -executionpolicy Bypass .\CopyFiles.ps1

 

Now this works outside of intune but I can not get it to work with intune if anyone could help me i would be appreciative 

 

Regards

Brendan 

 

 

5 Replies
Hey Brendan,
did you activate the option "Run this script using the logged on credentials"?

@Jannik_Reinhard I'm running it as a win32 app, Is it not possible to do it that way.

Okay sorry I understood that this is a Powershell script not a win32 app. Did you set the install behaviour to the user or to the system?

best response confirmed by Brendansmith (Copper Contributor)
Solution

@

 

I figured it out in the program it has to be set to user

 

3.png

1 best response

Accepted Solutions
best response confirmed by Brendansmith (Copper Contributor)
Solution

@

 

I figured it out in the program it has to be set to user

 

3.png

View solution in original post