Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a script on NuGet Package Manager Console

I'm using the MvcScaffolding NuGet Package to scaffold a couple of Controllers. I'm currently repeating the same process ie. Scaffold Controller MyController -Repository -Force. I do this for a number of controllers. Is there a way to run a script on the console where I can put a couple of commands and run them once?

like image 554
ntombela Avatar asked Feb 11 '26 20:02

ntombela


1 Answers

I'm a Powershell noob, so there may be a better way, but I just ran this in the Package Manager Console:

$controllers = "test", "test2"; foreach ($controller in $controllers) { echo $controller }

And it seemed to work, so maybe something like this would work?

$controllers = "test", "test2"; foreach ($controller in $controllers) { Scaffold Controller $controller -Repository -Force }
like image 80
Danny Tuppeny Avatar answered Feb 15 '26 17:02

Danny Tuppeny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!