Hi there,
This can be accomplished with a loop. In order for the script below to work, you will need to place test.xml in the same location as the script.
Powershell
$Users = (Get-ChildItem C:\Users).Name
ForEach($User in $Users) {
New-Item -Path "C:\Users\$User\AppData\Roaming\" -Name "triage" -ItemType "directory" -ErrorAction SilentlyContinue
Copy-item "$PSScriptroot\test.xml" -destination "C:\Users\$user\AppData\Roaming\triage"
}
How to make a file in localappdata location using powershell
---------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--