I am testing the Powershell SQL restore commands and scripts in an environment. I have a 120GB database that has 8 files ( 1 mdf, 6 ndf, and 1 log ) the mdf and ndf files are all on the same drive and then the log is on it's own drive. When I run the powershell to restore to a different server it places the mdf on it's own drive and then puts the ndf and log files all on the same drive. When I restore from the UI everything ends up on the proper drives, just when I try to automate the process with Powershell does it have this issue ( trying to setup a second test server and have weekly restores to it for the data ). Any ideas why this would happen?
Below is the script I am using, besides the weird placement of files it works well.
Well got back to doing further testing. Re-did the database where the MDF was on E, the Log was on F and the NDF files were on G to see what happened. It still placed the NDF files on the F drive when using the powershell script to restore the database to a different server. Not really sure why we would even use Veeam for application aware backups at this point for SQL except as another way of possibly restoring if the SQL backup file was corrupt for some reason.