Hello,
Iall the filesin the source directoryand sub-directoriesdizinlerdrefiles fromtarget1andtarget2preservingthe directory structureyou wantto copyanddeletefiles that are copied.(Duringthe deletionjustwant todeletion of files,I wantthe protectionin the source directorystructure.)
Thank you very muchfor your help.
$source = "D:\\Source\"$Target1="D:\\Target1\"$Target2="D:\\Target2\"$Files = get-childitem $source -Recurse foreach ($file in $Files| Where-Object { -not $_.psIsContainer } ){ write-host $file.fullname Copy-Item $file.FullName $Target1 -Recurse -force Copy-Item $file.FullName $Target2 -Recurse -force Remove-Item $file.fullname -force }