-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
Standardize Remove-DbaDatabaseSafely #5618
Standardize Remove-DbaDatabaseSafely #5618
Conversation
Don't try to start it, will just warn if not.
can't understand why is failing :-(
thanks for tackling this, claudio! I took a look and see nothing off 👎 This may be a skipper. if you'd like, you can also login to appveyor to see whats goingon. |
} | ||
process { | ||
if (Test-FunctionInterrupt) { | ||
return | ||
} | ||
try { | ||
Start-SqlAgent | ||
$destInstanceName = $destserver.InstanceName | ||
if ($destserver.InstanceName -eq '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include test for Edition because on Express this will cause the command to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Done.
|
||
if ($force -and $dbccgood -ne "Success") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($force -and $dbccgood -ne "Success") { | |
if ($Force -and $dbccgood -ne "Success") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Done.
if ($DefaultCompression -eq 1) { | ||
$null = Backup-DbaDatabase -SqlInstance $sqlinstance -SqlCredential $SqlCredential -Database $dbname -BackupFileName $filename -CompressBackup -Checksum | ||
} else { | ||
$null = Backup-DbaDatabase -SqlInstance $sqlinstance -SqlCredential $SqlCredential -Database $dbname -BackupFileName $filename -Checksum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of splatting will allow you to take this down to just calling the backup command once...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Done.
thank you so much shawn 💯 |
Thanks Shawn!
-WithReplace needed because database will only be dropped after job creation. Restore-DbaDatabase command uses Test-DbaBackupInformation which fails if database already exists
Create another database for the test between. Change expected warning message for Express Edition
Last test should run between on instance2 and instance3.
Should be #script:instance2 and $script:instance3
Should be #script:instance2 and $script:instance3
Fix order of source & destination instances
Reorder instances. Backup from 2016 test on 2017
Don't know why it stills yielding the error 😭 https://ci.appveyor.com/project/sqlcollaborative/dbatools/builds/24908965/job/4uq0kjt5gjw27502 |
What version of Pester are you using on your local machine? |
(This will obviously change, but not for 1.0 release) |
i had this issue the other day and cant remember how i fixed it 😭 |
@wsmelton was running with 4.5.0 |
Put context block back to last position
Was on the branch for that last one but changed to prerelease and I get the same error with the current version. |
It passed....quick merge it now @potatoqualitee |
Not yet.. |
I forgot! I never got this to work! It was Find-DbaAgent. So I'll merge this, disable the test and revisit later 💯 |
THANK YOU BOTH!!!! 🎉 |
Type of Change
Purpose
Standardize
Remove-DbaDatabaseSafely
function.Approach
Commands to test
Screenshots
Learning