CSNAPC-11480: Using Powershell to clone an SQL Database from secondary storage does not apply all logs as requested
Issue
To clone a database, it is normally possible to include all transaction logs since the backup to be applied automatically, even for restoring from secondary.
This either applies the current logs when cloning a single database locally, or by cloning the Log Directory disk (HLD) when the destination is on a different Host/instance from its last backup.
This works fine when done from the GUI, who will output this in the SCSQL job log:// Some comments here
<NUMBER_OF> Log backups of database [<DATABASE>] are successfully restored....
However, when attempting from Powershell, even with including the ArchivedLocators, fails to clone the Log Directory, since it doesn't pick up all that information from the repository (unlike GUI usage), and thereby fails to apply any extra logs. That example line will be missing from the SCSQL job log.
