I am trying to copy over a file in the root of C:\Citrix\Profiles.v2 to every users profile location but I keep running into errors. Was hoping that someone might have a better way of making this work.
Thanks again
Script:
# Variables
$users= Get-Childitem "c:\users" | Select-Object -Property name
Foreach ($user in $users) {
#Verify The profiles Directory Exists
$path = test-path "c:\users\$user\AppData\LocalLow\Sun Java\Test"
# If $path = True (Implied True in the below statement)
if ($path) {
$profiles=Get-ChildItem "c:\users\$user\AppData\LocalLow\Sun Java\Test" | select-object name
Foreach ($ffprofile in $profiles){
$ffox = "c:\users\$user\AppData\LocalLow\Sun Java\Test\test.txt"
#Test the Path
$path = Test-Path $ffox
# If $path = True (Implied True in the below statement)
if ($path) {
Copy-item "C:\Citrix\Profiles.v2\Sun Java\Test\Test.txt" -Destination "c:\users\$user\AppData\LocalLow\Sun Java\Test\$ffprofile" -Force
write-host "User: $user"
Write-host "Profile: $ffprofile"
}
}
}
}
Say what the errors are. Show what efforts you have made to debug the errors. Paste a screen shot.