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

Only add the RemainingArguments if they are defined. #20797

Merged
merged 1 commit into from
May 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 43 additions & 8 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ function Add-Migration
}

$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}

# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
$result = (EF $dteProject $dteStartupProject $params) -join "`n" | ConvertFrom-Json
Expand Down Expand Up @@ -143,7 +147,11 @@ function Drop-Database
{
$params = 'database', 'drop', '--force'
$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}

EF $dteProject $dteStartupProject $params -skipBuild
}
Expand Down Expand Up @@ -208,7 +216,12 @@ function Get-DbContext
{
$params = 'dbcontext', 'info', '--json'
$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}

# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
return (EF $dteProject $dteStartupProject $params) -join "`n" | ConvertFrom-Json
}
Expand Down Expand Up @@ -278,7 +291,11 @@ function Remove-Migration
}

$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}

# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
$result = (EF $dteProject $dteStartupProject $params) -join "`n" | ConvertFrom-Json
Expand Down Expand Up @@ -431,7 +448,10 @@ function Scaffold-DbContext
$params += '--force'
}

$params += $RemainingArguments
if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}

# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
$result = (EF $dteProject $dteStartupProject $params) -join "`n" | ConvertFrom-Json
Expand Down Expand Up @@ -511,7 +531,12 @@ function Script-DbContext
$params = 'dbcontext', 'script', '--output', $Output

$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}


EF $dteProject $dteStartupProject $params

Expand Down Expand Up @@ -621,7 +646,12 @@ function Script-Migration
}

$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}


EF $dteProject $dteStartupProject $params

Expand Down Expand Up @@ -700,7 +730,12 @@ function Update-Database
}

$params += GetParams $Context
$params += $RemainingArguments

if ($RemainingArguments -ne $null)
{
$params += $RemainingArguments
}


EF $dteProject $dteStartupProject $params
}
Expand Down