I want to append data from file1,file2,file3,file4 and file5 to finalfile.
so the copy would be
Copy-Item $file1 $finalfile
add-content -path $finalfile-value (get-content $file2)
add-content -path $finalfile-value (get-content $file3)
add-content -path $finalfile-value (get-content $file4)
add-content -path $finalfile-value (get-content $file5)
But if the file does not exits it will give an errors, so how can rewrite the code in case if some of the file is missing example file2 is missing, the script will still continue add content for file3 onward.