SQL Server: Get latest backup restore
From your description, you have a set of files some of which are full backups and some of which are differentials. If it were me, I'd use the various backup metadata interrogation commands inside the dbatools powershell module. Something like:

$bh = Get-DbaBackupInformation -SqlInstance yourRestoreServer -Path directoryForYourBackups;
$bh | Restore-DbaDatabase -SqlInstance yourRestoreServer -OutputScriptOnly;


That first command will go through and do a restore headeronly on all of the files and the second should select the most recent one(s) to do a restore on (which includes matching differential backups to full if that's an option).

If you don't already have the dbatools module installed, check out the installation instructions.