Wondering if anyone can help me solve this.
I am able to use the Package Manager Console to Enable-Migrations, Add-Migrations etc etc. But I want to be able to do this using c# code via the PowerShell object
What I have so far is:
var ps = PowerShell.Create();
ps.AddCommand("Set-ExecutionPolicy");
ps.AddArgument("Unrestricted");
ps.AddCommand("Import-Module");
ps.AddParameter("Name");
ps.AddArgument(@"'.\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1'";
ps.AddCommand("Add-Migration");
ps.AddParameter("Name");
ps.AddArgument("Migration21Sept");
ps.AddParameter("ProjectName");
ps.AddArgument("Context1");
ps.Invoke();
But when I execute this code I get an error stating: "The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program"