Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I wrote the current version of MvcScaffolding that you mention in your question. Here's how it adds PowerShell cmdlets to the Package Manager Console:</p> <ul> <li>Cmdlets are written in C# and compiled into a .NET assembly (see <a href="http://msdn.microsoft.com/en-us/magazine/cc163293.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/magazine/cc163293.aspx</a>)</li> <li>The .NET assembly is included in MvcScaffolding's "tools" folder (see <a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory" rel="noreferrer">http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory</a>)</li> <li>MvcScaffolding also contains an init.ps1 file that NuGet runs each time you open a solution containing it (also described at <a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Running_PowerShell_Scripts_During_Package_Installation_and_Removal" rel="noreferrer">http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Running_PowerShell_Scripts_During_Package_Installation_and_Removal</a>). This script uses the PowerShell "Import-Module" command to import the cmdlets from the .NET assembly, making them available in the console.</li> </ul> <p>Note that it's not actually necessary to write your cmdlets in C# and call Import-Module. A simpler alternative is to write them in PowerShell (see <a href="http://technet.microsoft.com/en-us/magazine/ff677563.aspx" rel="noreferrer">http://technet.microsoft.com/en-us/magazine/ff677563.aspx</a>) and define them inline in your NuGet package's init.ps1 file.</p> <p>Or, if your question is about how to add custom scaffolders to MvcScaffolding (e.g., so you can say "Scaffold MyCustomThing -somecustomparams"), then use the command "Scaffold CustomScaffolder MyCustomThing", and then edit the PS1/T4 files that appear in your CodeTemplates/Scaffolders folder. I'll blog more details about this soon.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload