Master#5348
Conversation
…ils with $Path is null when -UseExistingBackup is $true
…s an error when the user specified -UseExistingBackup = true
|
Thanks so much, @enriquecatala ! allcommands.ps1 is compiled by the publish process so there is no need to modify. I will make slight modifications to your PR so that it is mergeable 👍 |
Thank you. Can you please help me to understand what must be executed to force the allcommands.ps1 to be regenerated when working locally? In this case i wasn´t aware of this :( |
|
No problem- when the .git folder exists, it loads each of the files one by one and bypasses allcommands.ps1. So if you are working from a github repo directory, it should work without issues when you do
|
|
Thanks again, your changes have been merged! 💯 |
|
Thank you. Regards. |
|
Your code is now in the PowerShell Gallery 👍 |
Type of Change
Purpose
the purpose of this fix is because there is a bug when you want to deploy a log shipping by specifying a backup folder containing the backup full, and an error is thrown. $BackupPath is never initialized when UseExistingBackup is specified, so it throws an error "$Path is null" when trying to execute the Restore database command
Approach
This change only includes a missing line to specify where is the backup folder after validating that the backup folder is working properly
Commands to test
Invoke-DbaLogShipping -SourceSqlInstance source -DestinationSqlInstance destination -Database MyDatabase -FullBackupPath "\path\FULL" -UseExistingFullBackup -BackupNetworkPath "\PATH\LOG" -CopyDestinationFolder "\path\LOG" -CompressBackup -CopyScheduleDisabled -PrimaryThresholdAlertEnabled -RestoreThreshold 15 -SecondaryThresholdAlertEnabled
Screenshots
Learning