File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -147,10 +147,10 @@ Register-TabExpansion Get-DbContext @{
147
147
148
148
<#
149
149
. SYNOPSIS
150
- Gets information about a DbContext type .
150
+ Gets information about DbContext types .
151
151
152
152
. DESCRIPTION
153
- Gets information about a DbContext type .
153
+ Gets information about DbContext types .
154
154
155
155
. PARAMETER Context
156
156
The DbContext to use.
@@ -172,11 +172,19 @@ function Get-DbContext
172
172
$dteProject = GetProject $Project
173
173
$dteStartupProject = GetStartupProject $StartupProject $dteProject
174
174
175
- $params = ' dbcontext' , ' info' , ' --json'
176
- $params += GetParams $Context
177
-
178
- # NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
179
- return (EF $dteProject $dteStartupProject $params ) -join " `n " | ConvertFrom-Json
175
+ if ($Context )
176
+ {
177
+ $params = ' dbcontext' , ' info' , ' --json'
178
+ $params += GetParams $Context
179
+ # NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
180
+ return (EF $dteProject $dteStartupProject $params ) -join " `n " | ConvertFrom-Json
181
+ }
182
+ else
183
+ {
184
+ $params = ' dbcontext' , ' list' , ' --json'
185
+ # NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
186
+ return (EF $dteProject $dteStartupProject $params ) -join " `n " | ConvertFrom-Json | Format-Table - Property safeName - HideTableHeaders
187
+ }
180
188
}
181
189
182
190
#
You can’t perform that action at this time.
0 commit comments