Powershell script to append a text file on local user profiles
Hi Guys ,
I hope you are well. I am working on a script that appends a text file on local user profiles but excludes Admin profiles named "Admin-xxx" and public folder. So far this is what I have but getting no luck.
-------------------------------------------------------------------------------------------------
1 2 | ForEach ($user in (Get-ChildItem "C:\Users" -Exclude Public,Admin%)) {
Add-Content C:\$user\AppData\Roaming\App\app.txt "Text"
} ---------------------------------------------------------------------- Any advice will be highly appreciated. Have a nice day. |
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
EdT
9 years ago