Copy a File using PowerShell

email me

# Define Source and Target files
$Source = "c:\MyFolder1\TestFile.txt";
$Target = "c:\MyFolder2\TestFile.txt";

# Check to see if $Source exists, if so,
# copy it to $Target
if ([System.IO.File]::Exists($Source))  {
   [System.IO.File]::Copy($Source, $Target)
   "Source File ($Source) copied to ($Target)"
}
else {
"Source file ($Source) does not exist."
}