/tools/install.ps1
Powershell | 28 lines | 17 code | 6 blank | 5 comment | 2 complexity | 58df43ae6e6627e9f25522e4fe75a003 MD5 | raw file
1param($rootPath, $toolsPath, $package, $project) 2 3# Ensure that scaffolding works 4if (-not (Get-Command Invoke-Scaffolder)) { return } 5 6# The reason is issue (http://nuget.codeplex.com/workitem/595). Now we need to remove dummy file. 7if ($project) { $projectName = $project.Name } 8Get-ProjectItem "NuGetDymmy.txt" -Project $projectName | %{ $_.Delete() } 9 10Set-DefaultScaffolder -Name Model -Scaffolder ModelScaffolding.Model -SolutionWide -DoNotOverwriteExistingSetting 11 12$project.Object.References.Add("System.ComponentModel.DataAnnotations") 13 14# TODO: modify ".cs" when decide to support VB too 15# $lang = Get-ProjectLanguage 16# if ($lang -eq $null) { $lang = "cs" } 17 18Write-Host " " 19Write-Host "ModelScaffolding installed with dependencies and DataAnnotations reference." 20Write-Host " " 21Write-Host "You can generate your models using the following simple commands (without '//' comments):" 22Write-Host "PM> Scaffold Model MyModel // simplest MyModel.cs with Id, Name and annotations" 23Write-Host "PM> Scaffold Model MyModel -Folder Models -Force -NoAnnotations // simplest .\Models\MyModel.cs" 24Write-Host " " 25Write-Host "Also you can use more comprehensive commands with MVC Controllers and Views (just take a look at the output):" 26Write-Host "PM> Scaffold Model MyModel Id,Name,Test?,Count?,CreatedDate Models -Force " 27Write-Host " " 28Write-Host "Visit the http://modelscaffolding.codeplex.com/ to learn about output and conventions customization."