Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #5348

Merged
merged 3 commits into from
Apr 10, 2019
Merged

Master #5348

merged 3 commits into from
Apr 10, 2019

Conversation

enriquecatala
Copy link

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change, adds functionality)
  • Breaking change (effects multiple commands or functionality)
  • Ran manual Pester test and has passed (`.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/sqlcollaborative/appveyor-lab ?
  • Nunit test is included
  • Documentation
  • Build system

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

Enrique Catala Bañuls added 2 commits April 9, 2019 17:58
…ils with $Path is null when -UseExistingBackup is $true
…s an error when the user specified -UseExistingBackup = true
@potatoqualitee
Copy link
Member

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 👍

@potatoqualitee potatoqualitee changed the base branch from master to development April 9, 2019 17:12
@enriquecatala
Copy link
Author

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 :(

@potatoqualitee potatoqualitee merged commit 01bda12 into dataplat:development Apr 10, 2019
@potatoqualitee
Copy link
Member

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

Import-Module .\dbatools.psd1 -Force

@potatoqualitee
Copy link
Member

Thanks again, your changes have been merged! 💯

@enriquecatala
Copy link
Author

Thank you.
do you know when is this available in the Powershell Gallery to install via Import-Module? I really don´t know how frequently you update the gallery with the main branch code.

Regards.

@enriquecatala enriquecatala deleted the master branch April 10, 2019 14:05
@potatoqualitee
Copy link
Member

Your code is now in the PowerShell Gallery 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants