Home:ALL Converter>How to run Visual Studio 2017 Package Manager commands through PowerShell or command line

How to run Visual Studio 2017 Package Manager commands through PowerShell or command line

Ask Time:2019-01-01T14:53:53         Author:George Thomas

Json Formatter

How to run Visual Studio 2017 Package Manager commands through PowerShell or the command line?

I am using Visual studio 2017 for Entity Framework - Database migration, The following command is run on Package Manager console of Visual Studio:

  1. Enable-Migrations - ContextTypeName Database.TemplateDbContext
  2. add-migration InitialCreate
  3. Update-Database - Script -SourceMigration: $InitialDatabase (To generate migration script)
  4. Update-Database - Verbose (To update the database)

The above script is working fine, but now I'm working on automation of this database migration without using Visual Studio Package Manager. Is there any method to call these commands from either the command prompt or from PowerShell scripts?

Author:George Thomas,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53993579/how-to-run-visual-studio-2017-package-manager-commands-through-powershell-or-com
yy