I am currently scanning a directory and matching file names and then copying them to various file share locations (each file will have multiple desitnations). I am hard coding the locations and would like to instead store these locations in a csv file. The csv file should have 2 fields. , the destination column = path for the copy; and the string column = to identify the file file to be copied
heres what I am doing now
#Find and Move
$entries = Get-ChildItem $filepath
foreach ($entry in $entries) {
$Gen2 = 'C:\Lab\Gen2'
$Billing = 'C:\Lab\Billing'
$PdgMtnService = 'C:\Lab\PdgMtnService'
if ($entry.FullName -like '*MOTION TO COMPEL*'){ copy-item -Path $entry.FullName -Destination $Billing -Force }
if ($entry.FullName -like '*MOTION TO COMPEL*'){ copy-item -Path $entry.FullName -Destination $Gen2 -Force }
if ($entry.FullName -like '*MOTION TO COMPEL*'){ copy-item -Path $entry.FullName -Destination $PdgMtnService -Force }
}
“file”,“destination”
“t:\46\src\New Text Document.txt”,"t:\46\dest\a"
“t:\46\src\New Text Document.txt”,"t:\46\dest\b"
“t:\46\src\New Text Document (2).txt”,"t:\46\dest\c"
“t:\46\src\New Text Document (2).txt”,"t:\46\dest\d"