powershell - Passing parameters to method in MvcScaffolders -
i passing values first 2 parameters of t4scaffolding.scaffolder. not work excepted.
this powershell script file. lets give name test.ps1
[t4scaffolding.scaffolder(description = "enter description of service here")][cmdletbinding()] param( [string]$classname, [string]$project, [string]$codelanguage, [string[]]$templatefolders, [switch]$force = $false ) write-host "class name " $classname write-host "project name is" $project
then run on package manager console following
pm> scaffold test member consoleapplication1.domain
it prints me classname correctly project name 1 selected on nuget package manager console not 1 give.
class name member project name consoleapplication1.scaffolder
but excepted result is
class name member project name consoleapplication1.domain
now problem how pass classname , project parameter ? takes classname parameter ignoring second one.
edited
also tried 1 did not work either.
scaffold service -classname member -project consoleapplication1.domain
calling script powershell console, after removing t4scaffolding attribute, called scaffold.ps1 this:
.\scaffold test member consoleapplication1.domain
will return
class name test project name member
which expected. i'm not sure why different results, expected results not expected.
calling so:
scaffold service -classname member -project consoleapplication1.domain
does give expected results
class name member project name consoleapplication1.domain
$codelanguage service
so maybe it's nuget package manager console doing different
Comments
Post a Comment