after @Lee_Dailey pointed me in the right direction i changed the way i went about it below is the code snippet i wrote to get around the problem.
this will look for the number added to the end of a file and remove it for example
file(1).pdf it will remove the (1)
$SignedNt = GCI "PATH TO FILES" -Filter *.pdf
$Pattern = "[(#)]"
ForEach($Sign in $SignedNt){
if($Sign -match $Pattern){
Rename-Item -Path $Sign.FullName -NewName (($Sign.Name)-replace '\([0-9]\)' , '')
}
}
once this cleans the file it then runs the code below compare and move it which in turn answers my question.
$Source = "Path To PDF Files"
$Compare = "Path To PDF Files i Want To Compare"
GCI $Source | ForEach-Object{
if(Test-Path "$Compare\$($_.Name)") {
Move-Item $Compare\$($_.Name) "\\Destination\"
}
}
hope this helps the next person
.Substringit does nothing. i thought by adding.Substringit would look at the first 8 Characters on both files.(#)and remove it if found. THEN use that for your test. [grin]