Ok, I saw a answer here about this very same question but I'm not understanding it and what is the next step. The original question What am I supposed to do if I want this line to work
$from = "$dirFiles\config.xml"
$to = "C:\Users\$env:USERNAME\AppData\Roaming\Folder\Folder\config.xml"
Copy-Item $from $to -recurse
since $env:username resolves into my computer name when deployed though SCCM. How and where am I supposed enter:
([Security.Principal.WindowsIdentity]::GetCurrent()).Name.replace("$ENV:USERDOMAIN\","")
Hope you understand me
edit** I found what I could use thanks to bluuf and Syberdoor who pointed me in the right direction
**$CurrentUser = (Get-LoggedOnUser).UserName**
$from = "$dirFiles\config.xml"
$to = "C:\Users\$CurrentUser\AppData\Roaming\Folder\Folder\config.xml"
Copy-Item $from $to -recurse