I'm trying to automate the creation of backup jobs via PowerShell in B&R V6. I'm using the following command to create a job: Add-VBRBackupJob -Name "Job_Name" -Type "NET" -Server $server -Folder "\\Server_IP\Shared_Folder\" -Filename "File_Name" -Objects "VM_Name". This command creates a new backup job and besides, it creates a new repository called "Repository for job Job_Name". My problem is that this new repository isn't valid for the job since it's created as a "Windows Server" type by default and I'm using a shared folder on a NAS device (CIFS) and if I go to the GUI and open the properties of this new repository, everything is grayed out, so I can't change anything and, of course, if I try to run the job it fails.
I've managed to change the type of the repository by changing the type field's content from 0 to 2 on the database, and then it would let me set the credentials for the NAS and the job would run fine, but this method isn't neither automatic nor orthodox.
Besides, I've realised that when I run a backup job, It creates a new folder with the name of the job in specified repository. So, for me, It doesn't make any sense the use of 1 repository per job, with 1 repository per storage device is enough and it also simplifies the management.
In fact, I can't find any advantage on using repositories.
So, my question is: Is there a way to create a backup job specifying an existing repository as the target instead of specifying a route that would create a new repository?
Thanks in advance
