$path = (get-location).path
$files = get-childitem | where {$_.extension -eq ".bak"}
foreach($file in $files)
{
$dbPath = $path + '\' + $file
$dbName = $file.ToString().Replace(".bak", "")
write-host "Adding" $dbPath "to db " $dbName
Restore-SqlDatabase -ServerInstance "writeyourserverinstancehere" -Database $dbName -BackupFile $dbPath
}