Repository navigation
Add 'Drop-Database' - #6300
Merged
Merged
Add 'Drop-Database'#6300
Conversation
natemcmaster
force-pushed
the
drop-database
branch
from
August 11, 2016 17:02
acf5530 to
9a61c92
Compare
| about_EntityFrameworkCore | ||
| #> | ||
| function Drop-Database { | ||
| [CmdletBinding(PositionalBinding = $false)] |
Contributor
There was a problem hiding this comment.
SupportsShouldProcess = $true
This is the idiomatic way of doing confirmation and dry runs in PowerShell
natemcmaster
force-pushed
the
feature/ef.exe
branch
from
August 11, 2016 21:24
dbc150c to
9cc12d6
Compare
natemcmaster
force-pushed
the
drop-database
branch
2 times, most recently
from
August 11, 2016 22:30
282c206 to
3955c6a
Compare
Contributor
Author
natemcmaster
force-pushed
the
drop-database
branch
from
August 11, 2016 22:34
3955c6a to
6780d19
Compare
3 tasks
|
Should the default to drop a database be [Y]? |
Contributor
Author
|
I understand the concern, but IMO it's safe to assume that users intend to drop the database if they typed the command 'Drop-Database'. |
|
|
||
| if (!($info)) { | ||
| Write-Output 'Could not find a database to remove' | ||
| } elseif ($Force -or |
Contributor
There was a problem hiding this comment.
Using -Force for this in PowerShell is an anti-pattern. Instead, the user would either set $ConfirmPreference or use the -Confirm:$false default parameter.
natemcmaster
force-pushed
the
drop-database
branch
from
August 12, 2016 17:10
6780d19 to
3953723
Compare
Contributor
Author
Contributor
|
|
natemcmaster
force-pushed
the
drop-database
branch
from
August 12, 2016 21:30
3953723 to
66f9b58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Close #2476
cc @bricelam